home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / grafik / 3d & render tools / irit / bin / irit.hlp < prev    next >
Text File  |  1996-07-16  |  269KB  |  7,428 lines

  1.  
  2.  
  3.  
  4.  IRIT Version 6.0 User's Manual 
  5.  
  6.  A Solid modeling Program 
  7.  
  8.  Copyright (C) 1989, 1990-1996 Gershon Elber
  9.  
  10.  EMail: gershon@cs.technion.ac.il
  11.  
  12.  Join IRIT mailing list: gershon@cs.technion.ac.il
  13.  Mailing list: irit-mail@cs.technion.ac.il
  14.  Bug reports: irit-bugs@cs.technion.ac.il
  15.  
  16.  
  17. Introduction
  18.  
  19.    IRIT is a solid modeler developed for educational purposes. Although
  20.  small, it is now powerful enough to create quite complex scenes.
  21.  
  22.    IRIT started as a polygonal solid modeler and was originally developed
  23.  on an IBM PC under MSDOS. Version 2.0 was also ported to X11 and version 3.0
  24.  to SGI 4D systems. Version 3.0 also includes quite a few free form curves
  25.  and surfaces tools. See the UPDATE.NEW file for more detailed update
  26.  information. In Version 4.0, the display devices were enhanced, freeform
  27.  curves and surfaces have further support, functions can be defined, and
  28.  numerous improvement and optimizations are added.
  29. $
  30.  
  31. COPYRIGHTS
  32.  
  33.    BECAUSE IRIT AND ITS SUPPORTING TOOLS AS DOCUMENTED IN THIS DOCUMENT
  34.  ARE LICENSED FREE OF CHARGE, I PROVIDE ABSOLUTELY NO WARRANTY, TO THE EXTENT
  35.  PERMITTED BY APPLICABLE STATE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING, I
  36.  GERSHON ELBER PROVIDE THE IRIT PROGRAM AND ITS SUPPORTING TOOLS "AS IS"
  37.  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
  38.  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  39.  PARTICULAR PURPOSE.
  40.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THESE PROGRAMS IS WITH
  41.  YOU. SHOULD THE IRIT PROGRAMS PROVE DEFECTIVE, YOU ASSUME THE COST OF
  42.  ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  43.  
  44.    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL GERSHON ELBER,
  45.  BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES,
  46.  OR OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  47.  USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR A
  48.  FAILURE OF THE PROGRAMS TO OPERATE WITH PROGRAMS NOT DISTRIBUTED BY GERSHON
  49.  ELBER) THE PROGRAMS, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF
  50.  SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
  51.  
  52.  
  53.    IRIT is a freeware solid modeler. It is not public domain since I
  54.  hold copyrights on it. However, unless you are to sell or attempt to make
  55.  money from any part of this code and/or any model you made with this solid
  56.  modeler, you are free to make anything you want with it.
  57.  
  58.    IRIT can be compiled and executed on numerous Unix systems as well
  59.  as OS2, Windows NT and AmigaDOS. However, beware the MSDOS support is fading
  60.  away.
  61.  
  62.    You are not obligated to me or to anyone else in any way by using IRIT.
  63.    You are encouraged to share any model you made with it, but the models
  64.  you made with it are yours, and you have no obligation to share them.
  65.    You can use this program and/or any model created with it for non
  66.  commercial and non profit purposes only. An acknowledgement on the way the
  67.  models were created would be nice but is not required.
  68. $
  69.  
  70. Setup
  71.  
  72.    The IRIT program reads a file called irit.cfg each time it is executed.
  73.    This file configures the system. It is a regular text file with comments, so
  74.  you can edit it and properly modify it for your environment.
  75.    This file is being searched for in the directory specified by the
  76.  IRIT_PATH environment variable.
  77.    For example 'setenv IRIT_PATH /u/gershon/irit/bin/'.
  78.    Note IRIT_PATH must terminate with '/'. If the variable is not set only
  79.  the current directory is being searched for irit.cfg.
  80.  
  81.    In addition, if it exists, a file by the name of iritinit.irt will be
  82.  automatically executed before any other '.irt' file. This file may contain
  83.  any IRIT command. It is the proper place to put your predefined
  84.  functions and procedures if you have some.
  85.    This file will be searched much the same way IRIT.CFG is. The
  86.  name of this initialization file may be changed by setting the StartFile
  87.  entry in the configuration file.
  88.    This file is far more important starting at version 4.0, because of the new
  89.  function and procedure definition that has been added, and which is used
  90.  to emulate BEEP, VIEW, and INTERACT for example.
  91.  
  92.    The solid modeler can be executed in text mode (see the .cfg and the -t
  93.  flag below) on virtually any system with a C compiler.
  94.  
  95.   Under all systems the following environment variables must be set
  96.  and updated:
  97.  
  98.     path           Add to path the directory where IRIT's binaries are.
  99.     IRIT_PATH      Directory with config., help and IRIT's binary files.
  100.     IRIT_DISPLAY   The graphics driver program/options. Must be in path.
  101.     IRIT_BIN_IPC   If set, uses binary Inter Process Communication.
  102.  
  103.  
  104.  For example,
  105.  
  106.    set path = (path /u/gershon/irit/bin)
  107.    setenv IRIT_PATH  /u/gershon/irit/bin/
  108.    setenv IRIT_DISPLAY "xgldrvs -s-"
  109.    setenv IRIT_BIN_IPC 1
  110.  
  111.  to set /u/gershon/irit/bin as the binary directory and to use the sgi's
  112.  gl driver. If IRIT_DISPLAY is not set, the server (i.e., the IRIT
  113.  program) will prompt and wait for you to run a client (i.e., a display
  114.  driver). if IRIT_PATH is not set, none of the configuration files, nor
  115.  the help file will be found.
  116.  
  117.  If IRIT_BIN_IPC is not set, text based IPC is used, which is far
  118.  slower. No real reason not to use IRIT_BIN_IPC, unless it does not
  119.  work for you.
  120.  
  121.   In addition, the following optional environment variables may be set.
  122.  
  123.     IRIT_MALLOC       If set, apply dynamic memory consistency testing.
  124.                       Programs will execute much slower in this mode.
  125.     IRIT_MALLOC_PTR   Set to a pointer address and the program will
  126.                       scream once this pointer is allocated.
  127.     IRIT_NO_SIGNALS   If set, no signals are caught by IRIT.
  128.     IRIT_SERVER_HOST  Internet Name of IRIT server (used by graphics driver).
  129.     IRIT_SERVER_PORT  Used internally to the TCP socket number. Should not
  130.                       be set by users.
  131.  
  132.  
  133.  For example,
  134.  
  135.    setenv IRIT_MALLOC 1
  136.    setenv IRIT_MALLOC_PTR 1234567890
  137.    setenv IRIT_NO_SIGNALS 1
  138.    setenv IRIT_SERVER_HOST irit.cs.technion.ac.il
  139.  
  140.  IRIT_MALLOC is useful for programmers, or when reporting a memory
  141.  fatal error occurrence. IRIT_NO_SIGNALS is also useful for debugging
  142.  when contorl-C is used within a debugger. The IRIT_SERVER_HOST/PORT
  143.  controls the server/client (IRIT/Display device) communication.
  144.  
  145.  IRIT_SERVER_HOST and IRIT_SERVER_PORT are used in the unix and
  146.  Window NT ports of IRIT.
  147.  
  148.    See the section on the graphics drivers for more details.
  149.  
  150.    A session can be logged into a file as set via LogFile in the configuration
  151.  file. See also the LOGFILE command.
  152.  
  153.    The following command line options are available:
  154.  
  155.    IRIT [-t] [-z] [file.irt]
  156.  
  157.  
  158.     -t          Puts IRIT into text mode. No graphics will be displayed and
  159.                 the display commands will be ignored. Useful when one needs to
  160.                 execute an irt file to create data on a tty device...
  161.     -z          Prints usage message and current configuration/version
  162.                 information.
  163.     file.irt    A file to invoke directly instead of waiting to input from
  164.                 stdin. 
  165.  
  166.  
  167.  
  168.  Under OS2 the IRIT_DISPLAY environment variable must be set (if set) to
  169.  os2drvs.exe without any option (-s- will be passed automatically).
  170.  os2drvs.exe must be in a directory that is in the PATH environment
  171.  variable. IRIT_BIN_IPC can be used to signal binary IPC which is faster.
  172.  Here is a complete example:
  173.  
  174.  set IRIT_PATH=c:\irit\bin\
  175.  set IRIT_DISPLAY=os2drvs -s-
  176.  set IRIT_BIN_IPC=1
  177.  
  178.  assuming the directory specified by IRIT_PATH holds the executables of
  179.  IRIT and is in PATH.
  180.  
  181.  If IRIT_BIN_IPC is not set, text based IPC is used which is far
  182.  slower. No real reason not to use IRIT_BIN_IPC unless it does not
  183.  work for you.
  184.  
  185.  
  186.  The NT port uses sockets and is, in this respect, similar to the unix port.
  187.  The envirnoment variables IRIT_DISPLAY, IRIT_SERVER_HOST,
  188.  IRIT_BIN_IPC should all be set in a similar way to the Unix specific setup.
  189.  As a direct result, the server (IRIT) and the display device may be running
  190.  on different hosts. For example the server might be running on an NT system
  191.  while the display device will be running on an SGI4D exploiting the graphic's
  192.  hardware capabilities.  Here is a complete example:
  193.  
  194.  set IRIT_PATH=c:\irit\bin\
  195.  set IRIT_DISPLAY=wntgdrvs -s-
  196.  set IRIT_BIN_IPC=1
  197.  
  198.    Under UNIX using X11 (x11drvs driver) add the following options to
  199.  your .Xdefaults. Most are self explanatory. The Trans attributes control
  200.  the transformation window, while the View attributes control the view window.
  201.  SubWin attributes control the subwindows within the Transformation window.
  202.  
  203.     #if COLOR                                                        
  204.     irit*Trans*BackGround:            NavyBlue                       
  205.     irit*Trans*BorderColor:           Red                            
  206.     irit*Trans*BorderWidth:           3                              
  207.     irit*Trans*TextColor:             Yellow                         
  208.     irit*Trans*SubWin*BackGround:     DarkGreen                      
  209.     irit*Trans*SubWin*BorderColor:    Magenta                        
  210.     irit*Trans*Geometry:              =150x500+500+0                 
  211.     irit*Trans*CursorColor:           Green                          
  212.     irit*View*BackGround:             NavyBlue                       
  213.     irit*View*BorderColor:            Red                            
  214.     irit*View*BorderWidth:            3                              
  215.     irit*View*Geometry:               =500x500+0+0                   
  216.     irit*View*CursorColor:            Red                            
  217.     irit*MaxColors:                   15                             
  218.     #else                                                            
  219.     irit*Trans*Geometry:              =150x500+500+0                 
  220.     irit*Trans*BackGround:            Black                          
  221.     irit*View*Geometry:               =500x500+0+0                   
  222.     irit*View*BackGround:             Black                          
  223.     irit*MaxColors:                   1                              
  224.     #endif                                                           
  225.  
  226. $
  227.  
  228. First Usage
  229.  
  230.    Commands to IRIT are entered using a textual interface, usually
  231.  from the same window the program was executed from.
  232.  
  233.    Some important commands to begin with are,
  234.  
  235.    1. include("file.irt"); - will execute the commands in file.irt. Note
  236.       include can be recursive up to 10 levels. To execute the demo
  237.       (demo.irt) simply type 'include("demo.irt");'. Another way to run
  238.       the demo is by typing demo(); which is a predefined procedure defined
  239.       in iritinit.irt.
  240.  
  241.    2. help(""); - will print all available commands and how to get help on
  242.       them. A file called irit.hlp will be searched as irit.cfg is
  243.       being searched (see above), to provide the help.
  244.  
  245.    3. exit(); - close everything and exit IRIT.
  246.  
  247.    Most operators are overloaded. This means that you can multiply
  248.  two scalars (numbers), or two vectors, or even two matrices, with the same
  249.  multiplication operator (*). To get the on-line help on the
  250.  operator '*' type 'help("*");'
  251.  
  252.    The best way to learn this program (like any other program...) is by
  253.  trying it. Print the manual and study each of the commands available.
  254.    Study the demo programs (*.irt) provided as well.
  255.  
  256.    The "best" mode to use irit is via the emacs editor. With this distribution
  257.  an emacs mode for irit files (irt postfix) is provided (irit.el). Make your
  258.  .emacs load this file automatically. Loading file.irt will switch emacs into
  259.  Irit mode that supports the following three keystrokes:
  260.  
  261.     Meta-E             Executes the current line
  262.     Meta-R             Executes the current Region (Between Cursor and Mark)
  263.     Meta-S             Executes a single line from input buffer
  264.  
  265.    The first time one of the above keystrokes is hit, emacs will fork an Irit
  266.  process so that Irit's stdin is controlled via the above commands.
  267.    This emacs mode was tested under various unix environments and under OS2
  268.  2.x.
  269. $
  270.  
  271. Data Types
  272.   These are the Data Types recognized by the solid modeler. They are also
  273.  used to define the calling sequences of the different functions below:
  274.  
  275.     ConstantType       Scalar real type that cannot be modified.
  276.     NumericType        Scalar real type.
  277.     VectorType         3D real type vector.
  278.     PointType          3D real type point.
  279.     CtlPtType          Control point of a freeform curve or surface.
  280.     MatrixType         4 by 4 matrix (homogeneous transformation matrix).
  281.     PolygonType        Object consists of polygons.
  282.     PolylineType       Object consists of polylines.
  283.     CurveType          Object consists of curves.
  284.     SurfaceType        Object consists of surfaces.
  285.     TrimSrfType        Object consists of trimmed surfaces.
  286.     TrivarType         Object consists of trivariate function.
  287.     GeometricType      One of Polygon/lineType, CurveType, SurfaceType,
  288.                        TrimSrfType, TrivarType.
  289.     GeometricTreeType  A list of GeometricTypes or GeometricTreeTypes.
  290.     StringType         Sequence of chars within double quotes - "A string".
  291.                        Current implementation is limited to 80 chars.
  292.     AnyType            Any of the above.
  293.     ListType           List of (any of the above type) objects. List 
  294.                        size is dynamically increased, as needed.
  295.  
  296.   Although points and vectors are not the same, IRIT does not
  297.  destinguish between them, most of the time. This might change in the future.
  298. $
  299.  
  300. Commands
  301.  
  302.  These are all the commands and operators supported by the IRIT solid
  303.  modeler:
  304.  
  305.  
  306.     +          CEDITPT    CSURFACE   INTERACT   ROTZ       STRIVAR   
  307.     -          CEVAL      CTANGENT   IRITSTATE  ROTZ2V,    SURFPREV  
  308.     *          CEXTREMES  CTLPT      LIST       ROTZ2V2,   SURFREV   
  309.     /          CHDIR      CTRIMSRF   LN         RULEDSRF   SWEEPSRF  
  310.     ^          CINFLECT   CYLIN      LOAD       SAVE       SWPSCLSRF 
  311.     =          CINTERP    CZEROS     LOFFSET    SBEZIER    SYMBCPROD 
  312.     ==         CIRCLE     DSTPTLN    LOG        SBSPLINE   SYMBDIFF  
  313.     !=         CIRCPOLY   DSTPTPLN   LOGFILE    SCALE      SYMBDPROD 
  314.     <          CLNTCLOSE  DSTLNLN    MERGEPOLY  SCRVTR     SYMBPROD  
  315.     >          CLNTEXEC   ERROR      MESHSIZE   SDERIVE    SYMBSUM   
  316.     <=         CLNTREAD   EVOLUTE    MOFFSET    SDIVIDE    SYSTEM    
  317.     >=         CLNTWRITE  EXIT       MOMENT     SEDITPT    TAN       
  318.     ABS        CMESH      EXP        MSLEEP     SEVAL      TBEZIER   
  319.     ACOS       CMORPH     EXTRUDE    NIL        SFOCAL     TBSPLINE  
  320.     ADAPISO    CMULTIRES  FFCOMPAT   NTH        SFROMCRVS  TDERIVE   
  321.     ARC        CNORMAL    FFEXTREME  OFFSET     SGAUSS     TEVAL     
  322.     AREA       COERCE     FFMATCH    PAUSE      SIN        TEXTGEOM  
  323.     ASIN       COLOR      FFMERGE    PCIRCLE    SINTERP    TFROMSRFS 
  324.     ATAN       COMMENT    FFPTTYPE   PDOMAIN    SIZEOF     TIME      
  325.     ATAN2      COMPOSE    FFSPLIT    PLN3PTS    SMEANSQR   TINTERP   
  326.     ATTRIB     CON2       FLOOR      POLY       SMERGE     THISOBJ   
  327.     AOFFSET    CONE       FMOD       POWER      SMORPH     TORUS     
  328.     AWIDTH     CONTOUR    FOR        PRINTF     SNOC       TRANS     
  329.     BOOLONE    CONVEX     FREE       PRISA      SNORMAL    TREFINE   
  330.     BOOLSUM    COORD      FUNCTION   PROCEDURE  SNRMLSRF   TREGION   
  331.     BOX        COS        GBOX       PT3BARY    SPHERE     TRIMSRF   
  332.     BSP2BZR    CPOLY      GETLINE    PTLNPLN    SQRT       TSUBDIV   
  333.     BZR2BSP    CRAISE     GPOLYGON   PTPTLN     SRAISE     VARLIST   
  334.     CBEZIER    CREFINE    GPOLYLINE  PTSLNLN    SREFINE    VECTOR    
  335.     CBSPLINE   CREGION    HELP       RANDOM     SREGION    VIEW      
  336.     CCINTER    CREPARAM   HERMITE    RMATTR     SREPARAM   VIEWOBJ   
  337.     CCRVTR     CROSSEC    HOMOMAT    ROTVEC     SRINTER    VOLUME    
  338.     CDERIVE    CRVLNDST   IF         ROTX       STANGENT   WHILE     
  339.     CDIVIDE    CRVPTDST   INCLUDE    ROTY       STRIMSRF             
  340.  
  341. $
  342.  
  343. Functions and Variables
  344.  
  345.  Functions that return a NumericType:
  346.  
  347.     ABS        COS        EXP        POWER      THISOBJ   
  348.     ACOS       CLNTEXEC   FLOOR      RANDOM     VOLUME    
  349.     AREA       CPOLY      FMOD       SIN                  
  350.     ASIN       DSTPTLN    LN         SIZEOF               
  351.     ATAN       DSTPTPLN   LOG        SQRT                 
  352.     ATAN2      DSTLNLN    MESHSIZE   TAN                  
  353.  
  354.  
  355.  Functions that return a GeometricType:
  356.  
  357.     ADAPISO    CNORMAL    FFMATCH    RULEDSRF   STRIVAR   
  358.     ARC        COERCE     FFMERGE    SBEZIER    SURFPREV  
  359.     AOFFSET    COMPOSE    FFPTTYPE   SBSPLINE   SURFREV   
  360.     BOOLONE    CON2       FFSPLIT    SCRVTR     SWEEPSRF  
  361.     BOOLSUM    CONE       GBOX       SDERIVE    SWPSCLSRF 
  362.     BOX        CONTOUR    GETLINE    SDIVIDE    SYMBCPROD 
  363.     BSP2BZR    CONVEX     GPOLYGON   SEDITPT    SYMBDIFF  
  364.     BZR2BSP    COORD      GPOLYLINE  SEVAL      SYMBDPROD 
  365.     CBEZIER    CRAISE     HERMITE    SFOCAL     SYMBPROD  
  366.     CBSPLINE   CREFINE    LOFFSET    SFROMCRVS  SYMBSUM   
  367.     CCINTER    CREGION    MERGEPOLY  SGAUSS     TBEZIER   
  368.     CCRVTR     CREPARAM   MOFFSET    SINTERP    TBSPLINE  
  369.     CDERIVE    CROSSEC    MOMENT     SMEANSQR   TDERIVE   
  370.     CDIVIDE    CRVLNDST   NIL        SMERGE     TEVAL     
  371.     CEDITPT    CRVPTDST   OFFSET     SMORPH     TEXTGEOM  
  372.     CEVAL      CSURFACE   PCIRCLE    SNORMAL    TFROMSRFS 
  373.     CEXTREMES  CTANGENT   PDOMAIN    SNRMLSRF   TINTERP   
  374.     CINFLECT   CTRIMSRF   PLN3PTS    SPHERE     TORUS     
  375.     CINTERP    CTLPT      POLY       SRAISE     TREFINE   
  376.     CIRCLE     CYLIN      PRISA      SREFINE    TREGION   
  377.     CIRCPOLY   CZEROS     PROCEDURE  SREGION    TRIMSRF   
  378.     CLNTREAD   EVOLUTE    PT3BARY    SREPARAM   TSUBDIV   
  379.     CMESH      EXTRUDE    PTLNPLN    SRINTER              
  380.     CMORPH     FFCOMPAT   PTPTLN     STANGENT             
  381.     CMULTIRES  FFEXTREME  PTSLNLN    STRIMSRF             
  382.  
  383.  
  384.  Functions that create linear transformation matrices:
  385.  
  386.     HOMOMAT    ROTX       ROTZ       ROTZ2V2    TRANS     
  387.     ROTVEC     ROTY       ROTZ2V     SCALE                
  388.  
  389.  
  390.  Miscellaneous functions:
  391.  
  392.     ATTRIB     ERROR      INCLUDE    NTH        SYSTEM    
  393.     AWIDTH     EXIT       INTERACT   PAUSE      TIME      
  394.     CHDIR      FOR        IRITSTATE  PRINTF     VARLIST   
  395.     CLNTCLOSE  FREE       LIST       PROCEDURE  VECTOR    
  396.     CLNTWRITE  FUNCTION   LOAD       RMATTR     VIEW      
  397.     COLOR      HELP       LOGFILE    SAVE       VIEWOBJ   
  398.     COMMENT    IF         MSLEEP     SNOC       WHILE     
  399.  
  400.  
  401.  Variables that are predefined in the system:
  402.  
  403.     AXES              MACHINE           POLY_APPROX_TOL   VIEW_MAT         
  404.     DRAWCTLPT         POLY_APPROX_OPT   PRSP_MAT                           
  405.     FLAT4PLY          POLY_APPROX_UV    RESOLUTION                         
  406.  
  407.  
  408.  Constants that are predefined in the system:
  409.  
  410.     AMIGA        E3           MAGENTA      PARAM_CENTRIP SURFACE_TYPE
  411.     APOLLO       E4           MATRIX_TYPE  PARAM_CHORD  SUN         
  412.     BLACK        E5           MSDOS        PARAM_UNIFORM TRIMSRF_TYPE
  413.     BLUE         FALSE        NUMERIC_TYPE PI           TRIVAR_TYPE 
  414.     COL          GREEN        OFF          PLANE_TYPE   TRUE        
  415.     CTLPT_TYPE   HP           ON           POINT_TYPE   UNDEF_TYPE  
  416.     CURVE_TYPE   IBMOS2       P1           POLY_TYPE    UNIX        
  417.     CYAN         IBMNT        P2           RED          VECTOR_TYPE 
  418.     DEPTH        KV_FLOAT     P3           ROW          WHITE       
  419.     E1           KV_OPEN      P4           SGI          YELLOW      
  420.     E2           LIST_TYPE    P5           STRING_TYPE              
  421.  
  422. $
  423.  
  424. Language Description
  425.     The front end of the IRIT solid modeler is an infix parser that
  426.  mimics some of the C language behavior. The infix operators that are supported
  427.  are plus (+), minus (-), multiply (*), divide (/), and power (^), for
  428.  numeric operators, with the same precedence as in C.
  429.  
  430.     However, unlike the C language, these operators are overloaded,
  431.  or different action is taken, based upon the different operands.
  432.    This means that one can write '1 + 2', in which the plus sign denotes a
  433.  numeric addition, or one can write 'PolyObj1 + PolyObj2', in which case the
  434.  plus sign denotes the Boolean operation of a union between two geometric
  435.  objects.
  436.    The exact way each operator is overloaded is defined below.
  437.  
  438.    In this environment, reals, integers, and even Booleans, are all represented
  439.  as real types. Data are automatically promoted as necessary.
  440.    For example, the constants TRUE and FALSE are defined as 1.0 and 0.0
  441.  respectively.
  442.  
  443.    Each expression is terminated by a semicolon. An expression can be as
  444.  simple as 'a;' which prints the value of variable a, or as complex as:
  445.  
  446.     for ( t = 1.1, 0.1, 1.9,
  447.             cb1 = csurface( sb, COL, t ):
  448.             color( cb1, green ):
  449.             snoc( cb1, cb_all )
  450.         );
  451.  
  452.    While an expression is terminated with a semicolon, a colon is used to
  453.  terminate mini-expressions within an expression.
  454.  
  455.    Once a complete expression is read in (i.e., a semicolon is detected)
  456.  and parsed correctly (i.e. no syntax errors are found), it is executed.
  457.    Before each operator or a function is executed, parameter type matching
  458.  tests are made to make sure the operator can be applied to these
  459.  operand(s), or that the function gets the correct set of arguments.
  460.  
  461.    The parser is totally case insensitive, so Obj, obj, and OBJ will refer
  462.  to the same object, while MergePoly, MERGEPOLY, and mergePoly will refer
  463.  to the same function.
  464.  
  465.    Objects (Variables if you prefer) need not be declared. Simply use them
  466.  when you need them. Object names may be any alpha-numeric (and underscore)
  467.  string of at most 30 characters. By assigning to an old object, the old
  468.  object will be automatically deleted and if necessary its type will be
  469.  modified on the fly.
  470.  
  471.  Example:
  472.  
  473.     V = sin( 45 * pi / 180.0 );
  474.     V = V * vector( 1, 2, 3 );
  475.     V = V * rotx( 90 );
  476.     V = V * V;
  477.  
  478.  will assign to V a NumericType equal to the sine of 45 degrees, the VectorType
  479.  ( 1, 2, 3 ) scaled by the sine of 45, rotate that vector around the X axis
  480.  by 90 degrees, and finally a NumericType which is the dot (inner) product of
  481.  V with itself.
  482.  
  483.    The parser will read from stdin, unless a file is specified on the command
  484.  line or an INCLUDE command is executed. In both cases, when the end of file
  485.  is encountered, the parser will again wait for input from stdin. In order
  486.  to execute a file and quit in the end of the file, put an EXIT command as
  487.  the last command in the file.
  488. $
  489.  
  490. Overloading Plus
  491.  The + operator is overloaded above the following domains:
  492.  
  493.   NumericType + NumericType -> NumericType
  494.   VectorType  + VectorType  -> VectorType   (Vector addition)
  495.   MatrixType  + MatrixType  -> MatrixType   (Matrix addition)
  496.   PolygonType + PolygonType -> PolygonType  (Boolean UNION operation)
  497.   CurveType   + CurveType   -> CurveType    (Curve curve profiling)
  498.   CurveType   + CtlPtType   -> CurveType    (Curve control point profiling)
  499.   CtlPtType   + CtlPtType   -> CurveType    (Control points profiling)
  500.   ListType    + ListType    -> ListType     (Append lists operator)
  501.   StringType  + StringType  -> StringType   (String concat)
  502.   StringType  + RealType    -> StringType   (String concat, real as int string)
  503.  
  504.  Note: Boolean UNION of two disjoint objects (no common volume) will result
  505.  with the two objects combined. It is the USER responsibility to make sure that
  506.  the non intersecting objects are also disjoint - this system only tests for
  507.  no intersection.  Boolean UNION of two polyline objects will merge the list
  508.  of polylines.
  509. $
  510.  
  511. Overloading Minus
  512.  The - operator is overloaded above the following domains:
  513.  
  514.  As a binary operator:
  515.  
  516.   NumericType - NumericType -> NumericType
  517.   VectorType  - VectorType  -> VectorType   (Vectoric difference)
  518.   MatrixType  - MatrixType  -> MatrixType   (Matrix difference) 
  519.   PolygonType - PolygonType -> PolygonType  (Boolean SUBTRACT operation)
  520.  
  521.  As a unary operator:
  522.  
  523.   - NumericType -> NumericType
  524.   - VectorType  -> VectorType    (Scale vector by -1)
  525.   - MatrixType  -> MatrixType    (Scale matrix by -1)
  526.   - PolygonType -> PolygonType   (Boolean NEGATION operation)
  527.   - CurveType   -> CurveType     (Curve parameterization is reversed)
  528.   - SurfaceType -> SurfaceType   (Surface parameterization is reversed)
  529.  
  530.  Note: Boolean SUBTRACT of two disjoint objects (no common volume) will result
  531.  with an empty object. For both a curve and a surface parameterization, reverse
  532.  operation (binary minus) causes the object normal to be flipped as a side
  533.  effect.
  534. $
  535.  
  536. Overloading Astrisk
  537.  The * operator is overloaded above the following domains:
  538.  
  539.   NumericType * NumericType   -> NumericType
  540.   VectorType  * NumericType   -> VectorType    (Vector scaling)
  541.   VectorType  * CurveType     -> CurveType     (Inner product projection)
  542.   VectorType  * SurfaceType   -> SurfaceType   (Inner product projection)
  543.   VectorType  * VectorType    -> NumericType   (Inner product)
  544.   MatrixType  * NumericType   -> MatrixType    (Matrix Scaling)
  545.   MatrixType  * PointType     -> PointType     (Point transformation)
  546.   MatrixType  * CtlPtType     -> CtlPtType     (Ctl Point transformation)
  547.   MatrixType  * VectorType    -> VectorType    (Vector transformation)
  548.   MatrixType  * MatrixType    -> MatrixType    (Matrix multiplication)
  549.   MatrixType  * GeometricType -> GeometricType (Object transformation)
  550.   MatrixType  * ListType      -> ListType      (Object hierarchy transform.)
  551.   PolygonType * PolygonType   -> PolygonType   (Boolean INTERSECTION operation)
  552.  
  553.  Note: Boolean INTERSECTION of two disjoint objects (no common volume) will
  554.  result with an empty object. Object hierarchy transform transforms any
  555.  transformable object (GeometricType) found in the list recursively. Boolean
  556.  INTERSECTION of two planar (XY plane) polyline objects will compute the
  557.  intersection points of the two lists of polylines.
  558. $
  559.  
  560. Overloading Slash
  561.  The / operator is overloaded above the following domains:
  562.  
  563.   NumericType / NumericType -> NumericType
  564.   PolygonType / PolygonType -> PolygonType   (Boolean CUT operation)
  565.  
  566.  Note: Boolean CUT of two disjoint objects (no common volume) will result
  567.  with an empty object.
  568. $
  569.  
  570. Overloading Caret
  571.  The ^ operator is overloaded above the following domains:
  572.  
  573.   NumericType ^ NumericType -> NumericType
  574.   VectorType  ^ VectorType  -> VectorType  (Cross product)
  575.   MatrixType  ^ NumericType -> MatrixType  (Matrix to the (int) power)
  576.   PolygonType ^ PolygonType -> PolygonType (Boolean MERGE operation)
  577.   StringType  ^ StringType  -> StringType  (String concat)
  578.   StringType  ^ RealType    -> StringType  (String concat, real as real string)
  579.  
  580.  Note: Boolean MERGE simply merges the two sets of polygons without any
  581.  intersection tests. Matrix powers must be positive integers or -1, in which
  582.  case the matrix inverse (if it exists) is computed.
  583. $
  584.  
  585. Overloading Equal (Assignments)
  586.    Assignments are allowed as side effects, in any place in an expression.
  587.  If "Expr" is an expression, then "var = Expr" is the exact same expression
  588.  with the side effect of setting Var to that value. There is no guarantee
  589.  on the order of evaluation, so using Vars that are set within the same
  590.  expression is a bad practice. Use parentheses to force the order of
  591.  evaluation, i.e., "( var = Expr )".
  592. $
  593.  
  594. Comparison operators - ==, !=, <, >, <=, >=
  595.  The conditional comparison operators can be applied to the following
  596.  domains (o for a comparison operator):
  597.  
  598.   NumericType o NumericType -> NumericType
  599.   StringType  o StringType  -> NumericType
  600.   PointType   o PointType   -> NumericType
  601.   VectorType  o VectorType  -> NumericType
  602.   PlaneType   o PlaneType   -> NumericType
  603.  
  604.  The returned NumericType is non-zero if the condition holds, or zero if
  605.  not.
  606.    For PointTypes, VectorTypes, and PlaneTypes, only == and != comparisons
  607.  are valid. This is either the same or different.
  608.    For NumericTypes and StringTypes (uses strcmp) all comparisons are valid.
  609. $
  610.  
  611. Logical Operators - &&, ||, |
  612.  Complex logical expressions can be defined using the logical and (&&),
  613.  logical or (||) and logical not (!). These operators can be applied
  614.  to NumericTypes that are considered Boolean results. That is, true for a
  615.  non-zero value, and false otherwise.
  616.    The returned NumericType is true if both operands are true for the and
  617.  operator, at least one is true for the or operator, and the operand is
  618.  false for the not operator. In all other cases, a false is returned.
  619.    To make sure Logical expressions are readable, the and and or
  620.  operators are defined to have the same priority. Use parentheses to
  621.  disambiguate a logical expression and to make it more readable.
  622. $
  623.  
  624. Geometric Boolean Operations
  625.    The IRIT solid modeling system supports Boolean operations between
  626.  polyhedra objects. Freeform objects will be automaticaly converted to
  627.  a polygonal representation when used in Boolean operations.
  628.    The +, *, and - are overloaded to denote Boolean union, intersection
  629.  and subtraction when operating on geometric entities. - can also be
  630.  used as an unary operator to reverse the object orientation inside out.
  631.  
  632.    Example:
  633.  
  634.     resolution = 20;
  635.     B = box(vector(-1, -1, -0.25), 2, 1.2, 0.5);
  636.     C = con2(vector(0, 0, -1.5), vector(0, 0, 3), 0.7, 0.3);
  637.  
  638.     D = convex(B - C);
  639.     E = convex(C - B);
  640.     F = convex(B + C);
  641.     G = convex(B * C);
  642.  
  643.     tr = rotx( -90 ) * roty( 40 ) * rotx( -30 );
  644.  
  645.     All = list( D * tr * trans( vector(  0.6,  0.5, 0.0 ) ),
  646.                 E * tr * trans( vector(  3.0,  0.0, 0.0 ) ),
  647.                 F * tr * trans( vector( -2.0,  0.0, 0.0 ) ),
  648.                 G * tr * trans( vector(  0.7, -1.0, 0.0 ) ) )
  649.             * scale( vector( 0.25, 0.25, 0.25 ) )
  650.             * trans( vector( -0.1, -0.3, 0.0 ) );
  651.     view_mat = rotx( 0 );
  652.     view( list( view_mat, All ), on );
  653.     save( "booleans", list( view_mat, All ) );
  654.  
  655.     A complete example to compute the union, intersection and both
  656.  differences of a box and a truncated cone.
  657.  
  658.     There are several flags to control the Boolean operations. See
  659.  IRITSTATE command for the "InterCrv", "Coplanar", and "PolySort"
  660.  states.
  661. $
  662.  
  663. Priority of operators
  664.    The following table lists the priority of the different operators.
  665.  
  666.     Lowest             Operator           Name of operator  
  667.     priority           ,                  comma             
  668.                        :                  colon             
  669.                        &&, ||             logical and, logical or
  670.                        =,==,!=,<=,>=,<,>  assignment, equal, not equal, less
  671.                                           equal, greater equal, less, greater
  672.                        +, -               plus, minus       
  673.                        *, /               multiply, divide  
  674.     Highest            ^                  power             
  675.     priority           -, !               unary minus, logical not
  676.  
  677.  
  678.    The grammar of the IRIT parser follows similar guidelines as
  679.  the C language for simple expressions. However, complex statements differ.
  680.    See the IF, FOR, FUNCTION, and PROCEDURE below for the usage of these
  681.  clauses.
  682.  
  683. $
  684.  
  685. Function Description
  686. $
  687.  
  688. NumericType returning functions
  689. $
  690.  
  691. ABS
  692.  
  693.  NumericType ABS( NumericType Operand )
  694.  
  695.    Returns the absolute value of the given Operand.
  696. $
  697.  
  698. ACOS
  699.  
  700.  NumericType ACOS( NumericType Operand )
  701.  
  702.    Returns the arc cosine value (in radians) of the given Operand.
  703. $
  704.  
  705. AREA
  706.  
  707.  NumericType AREA( PolygonType Object )
  708.  
  709.    Returns the area of the given Object (in object units). Returned is
  710.  the area of the polygonal object, not the area of the primitive it might
  711.  approximate.
  712.  
  713.    This means that the area of a polygonal approximation of a sphere will be
  714.  returned, not the exact area of the sphere.
  715. $
  716.  
  717. ASIN
  718.  
  719.  NumericType ASIN( NumericType Operand )
  720.  
  721.    Returns the arc sine value (in radians) of the given Operand.
  722. $
  723.  
  724. ATAN
  725.  
  726.  NumericType ATAN( NumericType Operand )
  727.  
  728.    Returns the arc tangent value (in radians) of the given Operand.
  729. $
  730.  
  731. ATAN2
  732.  
  733.  NumericType ATAN2( NumericType Operand1, NumericType Operand2 )
  734.  
  735.    Returns the arc tangent value (in radians) of the given ratio:
  736.  Operand1 / Operand2, over the whole circle.
  737. $
  738.  
  739. COS
  740.  
  741.  NumericType COS( NumericType Operand )
  742.  
  743.    Returns the cosine value of the given Operand (in radians).
  744. $
  745.  
  746. CLNTEXEC
  747.  
  748.  NumericType CLNTEXEC( StringType ClientName )
  749.  
  750.    Initiate communication channels to a client named ClientName.
  751.  ClientName is executed by this function as a sub process and
  752.  two communication channels are opened between the IRIT server and the
  753.  new client, for read and write. See also CLNTREAD, CLNTWRITE, and
  754.  CLNTCLOSE. if ClientName is an empty string, the user is provided
  755.  with the new communication port to be used and the server blocks for the
  756.  user to manualy executed the client after setting the proper
  757.  IRIT_SERVER_HOST/PORT environment variables.
  758.  
  759.  Example:
  760.  
  761.    h1 = CLNTEXEC( "" );
  762.    h2 = CLNTEXEC( "nuldrvs -s-" );
  763.  
  764.  executes two clients, one is named nuldrvs and the other one is
  765.  prompted for by the user. As a result of the second invokation of
  766.  CLNTEXEC, the user will be prompted with a message similar to,
  767.  
  768.     Irit: Startup your program - I am waiting...
  769.  
  770.     setenv IRIT_SERVER_PORT 2182
  771.  
  772.  and he/she will need to set the proper environment variable and execute
  773.  their client manually.
  774. $
  775.  
  776. CPOLY
  777.  
  778.  NumericType CPOLY( PolygonType Object )
  779.  
  780.    Returns the number of polygons in the given polygonal Object.
  781. $
  782.  
  783. DSTPTLN
  784.  
  785.  NumericType DSTPTLN( PointType Pt, PointType LineOrig, VectorType LineRay )
  786.  
  787.    Returns the distance between a given point Pt and line
  788.  LineOrig, LineRay. See also PTPTLN.
  789. $
  790.  
  791. DSTPTPLN
  792.  
  793.  NumericType DSTPTPLN( PointType Pt, PlaneType Plane )
  794.  
  795.    Returns the distance between a given point Pt and plane
  796.  Plane.
  797. $
  798.  
  799. DSTLNLN
  800.  
  801.  NumericType DSTLNLN( PointType Line1Orig, VectorType Line1Ray,
  802.                       PointType Line2Orig, VectorType Line2Ray )
  803.  
  804.    Returns the distance between two lines defined by point LineiOrig
  805.  and ray LineiRay. See also PTSLNLN.
  806. $
  807.  
  808. EXP
  809.  
  810.  NumericType EXP( NumericType Operand )
  811.  
  812.    Returns the natural exponent value of the given Operand.
  813. $
  814.  
  815. FLOOR
  816.  
  817.  NumericType FLOOR( NumericType Operand )
  818.  
  819.    Returns the largest integer not greater than Operand.
  820. $
  821.  
  822. FMOD
  823.  
  824.  NumericType FMOD( NumericType Operand, NumericType Mod )
  825.  
  826.    Returns the floating point remainder of the division of Operand by
  827.  Mod.
  828. $
  829.  
  830. LN
  831.  
  832.  NumericType LN( NumericType Operand )
  833.  
  834.    Returns the natural logarithm value of the given Operand.
  835. $
  836.  
  837. LOG
  838.  
  839.  NumericType LOG( NumericType Operand )
  840.  
  841.    Returns the base 10 logarithm value of the given Operand.
  842. $
  843.  
  844. MESHSIZE
  845.  
  846.  NumericType MESHSIZE( SurfaceType Srf, ConstantType Direction )
  847.  
  848.    Returns the size of Srf's mesh in Direction, which
  849.  is one of COL or ROW.
  850.  
  851.  Example:
  852.  
  853.    RSize = MESHSIZE( Sphere, ROW );
  854.    CSize = MESHSIZE( Sphere, COL );
  855. $
  856.  
  857. POWER
  858.  
  859.  NumericType POWER( NumericType Operand, NumericType Exp )
  860.  
  861.    Returns Operand to the power of Exp.
  862. $
  863.  
  864. RANDOM
  865.  
  866.  NumericType RANDOM( NumericType Min, NumericType Max )
  867.  
  868.    Returns a randomized value between Min and Max.
  869. $
  870.  
  871. SIN
  872.  
  873.  NumericType SIN( NumericType Operand )
  874.  
  875.    Returns the sine value of the given Operand (in radians).
  876. $
  877.  
  878. SIZEOF
  879.  
  880.  NumericType SIZEOF( ListType List | PolyType Poly |
  881.                      CurveType Crv | StringType Str )
  882.  
  883.    Returns the length of a list if List, the number of polygons
  884.  if Poly, the length of the control polygon if Crv, or the
  885.  number of characters in string if Str.
  886.    If, however, only one polygon is in Poly, it returns the number
  887.  of vertices in that polygon.
  888.  
  889.  Example:
  890.  
  891.    len = SIZEOF( list( 1, 2, 3 ) );
  892.    numPolys = SIZEOF( axes );
  893.    numCtlpt = SIZEOF( circle( vector( 0, 0, 0 ), 1 ) );
  894.  
  895.  will assign the value of 3 to the variable len, set numPolys
  896.  to the number of polylines in the axes object, and set numCtlPt to 9, the
  897.  number of control points in a circle.
  898. $
  899.  
  900. SQRT
  901.  
  902.  NumericType SQRT( NumericType Operand )
  903.  
  904.    Returns the square root value of the given Operand.
  905. $
  906.  
  907. TAN
  908.  
  909.  NumericType TAN( NumericType Operand )
  910.  
  911.    Returns the tangent value of the given Operand (in radians).
  912. $
  913.  
  914. THISOBJ
  915.  
  916.  NumericType THISOBJ( StringType Object )
  917.  
  918.    Returns the object type of the given name of an Object. This can
  919.  be one of the constants,
  920.  
  921.     UNDEF_TYPE        VECTOR_TYPE       MATRIX_TYPE       SURFACE_TYPE     
  922.     NUMERIC_TYPE      POINT_TYPE        POLY_TYPE         TRIMSRF_TYPE     
  923.     STRING_TYPE       CTLPT_TYPE        CURVE_TYPE        TRIVAR_TYPE      
  924.  
  925.    This is also a way to ask if an object by a given name do exist (if the
  926.  returned type is UNDEF_TYPE or not).
  927. $
  928.  
  929. VOLUME
  930.  
  931.  NumericType VOLUME( PolygonType Object )
  932.  
  933.    Returns the volume of the given Object (in object units). It returns
  934.  the volume of the polygonal object, not the volume of the object it might
  935.  approximate.
  936.  
  937.    This routine decomposes all non-convex polygons to convex ones as a side
  938.  effect (see CONVEX).
  939. $
  940.  
  941. GeometricType returning functions
  942. $
  943.  
  944. ADAPISO
  945.  
  946.  CurveType ADAPISO( SurfaceType Srf, NumericType Dir, NumericType Eps,
  947.                     NumericType FullIso, NumericType SinglePath )
  948.  
  949.  Constructs a coverage to Srf using isocurve in the Dir direction,
  950.  so that for any point p on surface Srf, there exists a point on one of
  951.  the isocurves that is close to p within Eps. If FullIso, the
  952.  extracted isocurves span the entire surface domain, otherwise they may
  953.  span only a subset of the domain. If SinglePath, an approximation to
  954.  a single path (Hamiltonian path) that visits all isocurves is constructed.
  955.  
  956.     srf = sbezier( list( list( ctlpt( E3, -0.5, -1.0,  0.0 ),
  957.                                ctlpt( E3,  0.4,  0.0,  0.1 ),
  958.                                ctlpt( E3, -0.5,  1.0,  0.0 ) ),
  959.                          list( ctlpt( E3,  0.0, -0.7,  0.1 ),
  960.                                ctlpt( E3,  0.0,  0.0,  0.0 ),
  961.                                ctlpt( E3,  0.0,  0.7, -0.2 ) ),
  962.                          list( ctlpt( E3,  0.5, -1.0,  0.1 ),
  963.                                ctlpt( E3, -0.4,  0.0,  0.0 ),
  964.                                ctlpt( E3,  0.5,  1.0, -0.2 ) ) ) );
  965.     aiso = ADAPISO( srf, COL, 0.1, FALSE, FALSE );
  966.  
  967.  Constructs an adaptive isocurve approximation with tolerance of 0.1 to
  968.  surface srf in direction COL. Isocurves are allowed to span a
  969.  subset of the surface domain. No single path is needed.
  970.  
  971.  The SinglePath option is currently not supported.
  972. $
  973.  
  974. ARC
  975.  
  976.  CurveType ARC( VectorType StartPos, VectorType Center, VectorType EndPos )
  977.  
  978.  Constructs an arc between the two end points StartPos and EndPos,
  979.  centered at Center. Arc will always be less than 180 degrees, so the
  980.  shortest circular path from StartPos to EndPos is selected. The
  981.  case where StartPos, Center, and EndPos are collinear is
  982.  illegal, since it attempts to define a 180 degrees arc. Arc is constructed
  983.  as a single rational quadratic Bezier curve.
  984.  
  985.  Example:
  986.  
  987.     Arc1 = ARC( vector( 1.0, 0.0, 0.0 ),
  988.                 vector( 1.0, 1.0, 0.0 ),
  989.                 vector( 0.0, 1.0, 0.0 ) );
  990.  
  991.  constructs a 90 degrees arc, tangent to both the X and Y axes at coordinate 1.
  992. $
  993.  
  994. AOFFSET
  995.  
  996.  CurveType AOFFSET( CurveType Crv, NumericType OffsetDistance,
  997.                     NumericType Epsilon, NumericType TrimLoops,
  998.                     NumericType BezInterp )
  999.  
  1000.  Computes an offset of OffsetDistance with globally bounded error
  1001.  (controlled by Epsilon). The smaller Epsilon is, the better
  1002.  the approximation to the offset. The bounded error is achieved by adaptive
  1003.  refinement of the Crv.
  1004.    If TrimLoops is TRUE or on, the regions of the object that
  1005.  self-intersect as a result of the offset operation are trimmed away.
  1006.    If BezInterp is TRUE, each curve's segment is interpolated instead
  1007.  of approximated.
  1008.  
  1009.  Example:
  1010.  
  1011.     OffCrv1 = AOFFSET( Crv, 0.5, 0.01, FALSE, FALSE );
  1012.     OffCrv2 = AOFFSET( Crv, 0.5, 0.01, TRUE, FALSE );
  1013.  
  1014.  computes an adaptive offset to Crv with OffsetDistance of
  1015.  0.5 and Epsilon of 0.01 and trims the self-intersection loops in
  1016.  the second instrance.
  1017.  See also OFFSET, LOFFSET, and MOFFSET.
  1018. $
  1019.  
  1020. BOOLONE
  1021.  
  1022.  SurfaceType BOOLONE( CurveType Crv )
  1023.  
  1024.  Given a closed curve, the curve is subdivided into four segments equally
  1025.  spaced in the parametric space that are fed into BOOLSUM. Useful if
  1026.  a surface should "fill" the area enclosed by a closed curve.
  1027.  
  1028.  Example:
  1029.  
  1030.  Srf = BOOLONE( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
  1031.  
  1032.  Creates a disk surface containing the area enclosed by the unit circle.
  1033. $
  1034.  
  1035. BOOLSUM
  1036.  
  1037.  SurfaceType BOOLSUM( CurveType Crv1, CurveType Crv2,
  1038.                       CurveType Crv3, CurveType Crv4 )
  1039.  
  1040.  Construct a surface using the provided four curves as its four boundary
  1041.  curves. Curves do not have to have the same order or type, and will be
  1042.  promoted to their least common denominator. The end points of the four
  1043.  curves should match as follows:
  1044.  
  1045.     Crv1 start point,              to Crv3 start point.        
  1046.     Crv1 end point,                to Crv4 start point.        
  1047.     Crv2 start point,              to Crv3 end point.          
  1048.     Crv2 end point,                to Crv4 end point.          
  1049.  
  1050.  where Crv1 and Crv2 are the two boundaries in one parametric
  1051.  direction, and Crv3 and Crv4 are the two boundaries in the other
  1052.  parametric direction.
  1053.  
  1054.  Example:
  1055.  
  1056.     Cbzr1 = cbezier( list( ctlpt( E3, 0.1, 0.1, 0.1 ),
  1057.                            ctlpt( E3, 0.0, 0.5, 1.0 ),
  1058.                            ctlpt( E3, 0.4, 1.0, 0.4 ) ) );
  1059.     Cbzr2 = cbezier( list( ctlpt( E3, 1.0, 0.2, 0.2 ),
  1060.                            ctlpt( E3, 1.0, 0.5, -1.0 ),
  1061.                            ctlpt( E3, 1.0, 1.0, 0.3 ) ) );
  1062.     Cbsp3 = cbspline( 4,
  1063.                       list( ctlpt( E3, 0.1,  0.1, 0.1 ),
  1064.                             ctlpt( E3, 0.25, 0.0, -1.0 ),
  1065.                             ctlpt( E3, 0.5,  0.0, 2.0 ),
  1066.                             ctlpt( E3, 0.75, 0.0, -1.0 ),
  1067.                             ctlpt( E3, 1.0,  0.2, 0.2 ) ),
  1068.                       list( KV_OPEN ) );
  1069.     Cbsp4 = cbspline( 4,
  1070.                       list( ctlpt( E3, 0.4,  1.0, 0.4 ),
  1071.                             ctlpt( E3, 0.25, 1.0, 1.0 ),
  1072.                             ctlpt( E3, 0.5,  1.0, -2.0 ),
  1073.                             ctlpt( E3, 0.75, 1.0, 1.0 ),
  1074.                             ctlpt( E3, 1.0,  1.0, 0.3 ) ),
  1075.                       list( KV_OPEN ) );
  1076.     Srf = BOOLSUM( Cbzr1, Cbzr2, Cbsp3, Cbsp4 );
  1077. $
  1078.  
  1079. BOX
  1080.  
  1081.  PolygonType BOX( VectorType Point,
  1082.                   NumericType Dx, NumericType Dy, NumericType Dz )
  1083.  
  1084.    Creates a BOX polygonal object, whose boundary is coplanar with the
  1085.  XY, XZ, and YZ planes. The BOX is defined by Point as
  1086.  base position, and Dx, Dy, Dz as BOX dimensions. Negative dimensions
  1087.  are allowed.
  1088.  
  1089.  Example:
  1090.  
  1091.     B = BOX( vector( 0, 0, 0 ), 1, 1, 1);
  1092.  
  1093.  creates a unit cube from 0 to 1 in all axes.
  1094. $
  1095.  
  1096. BZR2BSP
  1097.  
  1098.  CurveType BZR2BSP( CurveType Crv )
  1099.  
  1100.  or
  1101.  
  1102.  SurfaceType BZR2BSP( SurfaceType Srf )
  1103.  
  1104.    Creates a Bspline curve or a Bspline surface from the given Bezier curve or
  1105.  Bezier surface. The Bspline curve or surface is assigned open end knot
  1106.  vector(s) with no interior knots, in the parametric domain of zero to one.
  1107.  
  1108.  Example:
  1109.  
  1110.     BspSrf = BZR2BSP( BzrSrf );
  1111. $
  1112.  
  1113. BSP2BZR
  1114.  
  1115.  CurveType | ListType BSP2BZR( CurveType Crv )
  1116.  
  1117.  or
  1118.  
  1119.  SurfaceType | ListType BSP2BZR( SurfaceType Srf )
  1120.  
  1121.    Creates Bezier curve(s) or surface(s) from a given Bspline curve or a
  1122.  Bspline surface. The Bspline input is subdivided at all internal knots to
  1123.  create Bezier curves or surfaces. Therefore, if the input Bspline does have
  1124.  internal knots, a list of Bezier curves or surfaces is returned. Otherwise,
  1125.  a single Bezier curve or surface is returned.
  1126.  
  1127.  Example:
  1128.  
  1129.     BzrCirc = BSP2BZR( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
  1130.  
  1131.  would subdivide the unit circle into four 90 degrees Bezier arcs returned
  1132.  in a list.
  1133. $
  1134.  
  1135. CBEZIER
  1136.  
  1137.  CurveType CBEZIER( ListType CtlPtList )
  1138.  
  1139.    Creates a Bezier curve out of the provided control point list. CtlPtList
  1140.  is a list of control points, all of which must be of type (E1-E5, P1-P5),
  1141.  or regular PointType defining the curve's control polygon. Curve's point type
  1142.  will be of a space which is the union of the spaces of all points.
  1143.  
  1144.  Example:
  1145.  
  1146.     s45 = sin(pi / 4);
  1147.     Arc90 = CBEZIER( list( ctlpt( P2, 1.0, 0.0, 1.0 ),
  1148.                            ctlpt( P2, s45, s45, s45 ),
  1149.                            ctlpt( P1, 1.0, 1.0 ) ) );
  1150.  
  1151.  constructs an arc of 90 degrees as a rational quadratic Bezier curve.
  1152. $
  1153.  
  1154. CBSPLINE
  1155.  
  1156.  CurveType CBSPLINE( NumericType Order, ListType CtlPtList,
  1157.                                                         ListType KnotVector )
  1158.  
  1159.    Creates a Bspline curve out of the provided control point list, the
  1160.  knot vector, and the specified order. CtlPtList is a list of control
  1161.  points, all of which must be of type (E1-E5, P1-P5), or regular PointType
  1162.  defining the curve's control polygon. Curve's point type will be of a space
  1163.  which is the union of the spaces of all points.
  1164.    The length of the KnotVector must be equal to the number of control
  1165.  points in CtlPtList plus the Order. If, however, the length of
  1166.  the knot vector is equal to #CtlPtList + Order + Order - 1 the curve
  1167.  is assumed periodic.
  1168.    The knot vector list may be specified as either list( KV_OPEN ) or
  1169.  list( KV_FLOAT ) or list( KV_PERIODIC ) in which a uniform
  1170.  open, uniform floating or uniform periodic knot vector with the appropriate
  1171.  length is automatically constructed. 
  1172.  
  1173.  Example:
  1174.  
  1175.     s45 = sin(pi / 4);
  1176.     HalfCirc = CBSPLINE( 3,
  1177.                          list( ctlpt( P3,  1.0,  1.0,  0.0, 0.0 ),
  1178.                                ctlpt( P3,  s45,  s45,  s45, 0.0 ),
  1179.                                ctlpt( P3,  1.0,  0.0,  1.0, 0.0 ),
  1180.                                ctlpt( P3,  s45, -s45,  s45, 0.0 ),
  1181.                                ctlpt( P3,  1.0, -1.0,  0.0, 0.0 ) ),
  1182.                          list( 0, 0, 0, 1, 1, 2, 2, 2 ) );
  1183.  
  1184.  constructs an arc of 180 degrees in the XZ plane as a rational quadratic
  1185.  Bspline curve.
  1186.  
  1187.  Example:
  1188.  
  1189.     c = CBSPLINE( 4,
  1190.                   list( ctlpt( E2,  0.5,  0.5 ),
  1191.                         ctlpt( E2, -0.5,  0.5 ),
  1192.                         ctlpt( E2, -0.5, -0.5 ),
  1193.                         ctlpt( E2,  0.5, -0.5 ) ),
  1194.                   list( KV_PERIODIC ) );
  1195.     color( c, red );
  1196.     viewobj( c );
  1197.     
  1198.     c1 = cregion( c, 3, 4 );
  1199.     color( c1, green );
  1200.     c2 = cregion( c, 4, 5 );
  1201.     color( c2, yellow );
  1202.     c3 = cregion( c, 5, 6 );
  1203.     color( c3, cyan );
  1204.     c4 = cregion( c, 6, 7 );
  1205.     color( c3, magenta );
  1206.     viewobj( list( c1, c2, c3, c4 ) );
  1207.  
  1208.  creates a periodic curve and extracts its four polynomial domains as four
  1209.  open end Bspline curves.
  1210. $
  1211.  
  1212. CCINTER
  1213.  
  1214.  ListType CCINTER( CurveType Crv1, CurveType Crv2, NumericType Epsilon,
  1215.                                                        NumericType SelfInter )
  1216.  
  1217.  or
  1218.  
  1219.  SurfaceType CCINTER( CurveType Crv1, CurveType Crv2, NumericType Epsilon,
  1220.                                                        NumericType SelfInter )
  1221.  
  1222.    Computes the intersection point(s) of Crv1 and Crv2 in the
  1223.  XY plane. Since this computation involves numeric operations, Epsilon
  1224.  controls the accuracy of the parametric values of the result.
  1225.    It returns a list of PointTypes, each containing the parameter of Crv1
  1226.  in the X coordinate, and the parameter of Crv2 in the Y coordinate.
  1227.    If, however, Epsilon is negative, a scalar field surface representing
  1228.  the square of the distance function is returned instead.
  1229.    If SelfInter is TRUE, Crv1 and Crv2 can be the same
  1230.  curve, and self-intersection points are searched instead.
  1231.  
  1232.  Example:
  1233.  
  1234.  crv1 = cbspline( 3,
  1235.                   list( ctlpt( E2, 0, 0 ),
  1236.                         ctlpt( E2, 0, 0.5 ),
  1237.                         ctlpt( E2, 0.5, 0.7 ),
  1238.                         ctlpt( E2, 1, 1 ) ),
  1239.                   list( KV_OPEN ) );
  1240.  crv2 = cbspline( 3,
  1241.                   list( ctlpt( E2, 1, 0 ),
  1242.                         ctlpt( E2, 0.7, 0.25 ),
  1243.                         ctlpt( E2, 0.3, 0.5 ),
  1244.                         ctlpt( E2, 0, 1 ) ),
  1245.                   list( KV_OPEN ) );
  1246.  inter_pts = CCINTER( crv1, crv2, 0.0001, FALSE );
  1247.  
  1248.  Computes the parameter values of the intersection point of crv1 and
  1249.  crv2 to a tolerance of 0.0001.
  1250. $
  1251.  
  1252. CCRVTR
  1253.  
  1254.  NumericType CCRVTR( CurveType Crv, NumericType Epsilon )
  1255.  
  1256.  or
  1257.  
  1258.  CurveType CCRVTR( CurveType Crv, NumericType Epsilon )
  1259.  
  1260.    Computes the extreme curvature points on Crv in the XY plane.
  1261.  This set includes not only points of maximum (convexity) and mimumum
  1262.  (concavity) curvature, but also points of zero curvature such as
  1263.  inflection points.
  1264.    Since this operation is partially numeric, Epsilon is used to set
  1265.  the needed accuracy. It returns the parameter value(s) of the location(s)
  1266.  with extreme curvature along the Crv.
  1267.    If, however, Epsilon is negative, the curvature scalar field
  1268.  curve is returned as a two dimensional rational vector field curve, for
  1269.  which the first dimension is equal to the parameter, and the second is the
  1270.  curvature value at that parameter.
  1271.  
  1272.    This function computes the curvature scalar field for planar curves as,
  1273.  
  1274.           x' y'' - x'' y' 
  1275.    k(t) = ----------------
  1276.                2     2  3/2
  1277.            ( x'  + y'  )
  1278.  
  1279.  and computes kN for three dimensional curves as the following vector field,
  1280.  
  1281.                                   C' x C''     C'    (C' x C'') x C'
  1282.    k(t) N(t) = K(t) B(t) x T(t) = -------- x ----- = ---------------
  1283.                                         3    | C' |            4
  1284.                                    | C'|                 | C' |
  1285.  
  1286.  The extremum values are extracted from the computed curvature field.
  1287.  This curvature field is a high order curve, even if the input geometry is
  1288.  of low order. This is especially true for rational curves, for which the
  1289.  quotient rule for differentiation is used and almost doubles the degree
  1290.  in every differentiation.
  1291.  
  1292.  See also CZEROS, CEXTREMES, and SCRVTR.
  1293.  
  1294.  Example:
  1295.  
  1296.  crv = cbezier( list( ctlpt( E2, -1.0,  0.5 ),
  1297.                       ctlpt( E2, -0.5, -2.0 ),
  1298.                       ctlpt( E2,  0.0,  1.0 ),
  1299.                       ctlpt( E2,  1.0,  0.0 ) ) ) * rotz( 30 );
  1300.  crvtr = CCRVTR( crv, 0.001 );
  1301.  pt_crvtr = nil();
  1302.  pt = nil();
  1303.  for ( i = 1, 1, sizeof( crvtr ),
  1304.      ( pt = ceval( crv, nth( crvtr, i ) ) ):
  1305.      snoc( pt, pt_crvtr )
  1306.  );
  1307.  interact( list( crv, pt_crvtr ) );
  1308.  
  1309.  finds the extreme curvature points in Crv and displays them all
  1310.  with the curve.
  1311. $
  1312.  
  1313. CDERIVE
  1314.  
  1315.  CurveType CDERIVE( CurveType Curve )
  1316.  
  1317.    Returns a vector field curve representing the differentiated curve,
  1318.  also known as the Hodograph curve.
  1319.  
  1320.  Example:
  1321.  
  1322.  Circ = circle( vector( 0.0, 0.0, 0.0 ), 1.0 );
  1323.  Hodograph = CDERIVE( Circ );
  1324. $
  1325.  
  1326. CDIVIDE
  1327.  
  1328.  ListType CDIVIDE( CurveType Curve, NumericType Param )
  1329.  
  1330.    Subdivides a curve into two sub-curves at the specified parameter value.
  1331.  Curve can be either a Bspline curve in which Param must be
  1332.  within the Curve's parametric domain, or a Bezier curve in which Param
  1333.  can be arbitrary, extrapolating if not in the range of zero to one.
  1334.  
  1335.    Returns a list of the two sub-curves. The individual curves may be
  1336.  extracted from the list using the NTH command.
  1337.  
  1338.  Example:
  1339.  
  1340.  CrvLst = CDIVIDE( Crv, 1.3 );
  1341.  Crv1 = nth( CrvLst, 1 );
  1342.  Crv2 = nth( CrvLst, 2 );
  1343.  
  1344.  subdivides the curve Crv at the parameter value of 0.5.
  1345. $
  1346.  
  1347. CEDITPT
  1348.  
  1349.  CurveType CEDITPT( CurveType Curve, CtlPtType CtlPt, NumericType Index )
  1350.  
  1351.    Provides a simple mechanism to manually modify a single control point number
  1352.  Index (base count is 0) in Curve, by substituting CtlPt
  1353.  instead. CtlPt must have the same point type as the control points of
  1354.  the  Curve. Original curve Curve is not modified.
  1355.  
  1356.  Example:
  1357.  
  1358.     CPt = ctlpt( E3, 1, 2, 3 );
  1359.     NewCrv = CEDITPT( Curve, CPt, 1 );
  1360.  
  1361.  constructs a NewCrv with the second control point of Curve being
  1362.  CPt.
  1363. $
  1364.  
  1365. CEVAL
  1366.  
  1367.  CtlPtType CEVAL( CurveType Curve, NumericType Param )
  1368.  
  1369.    Evaluates the provided Curve at the given Param value.
  1370.  Param should be in the curve's parametric domain if Curve is
  1371.  a Bspline curve, or between zero and one if Curve is a Bezier curve.
  1372.  The returned control point has the same point type as the control points
  1373.  of the Curve.
  1374.  
  1375.  Example:
  1376.  
  1377.     CPt = CEVAL( Crv, 0.25 );
  1378.  
  1379.  evaluates Crv at the parameter value of 0.25.
  1380. $
  1381.  
  1382. CEXTREMES
  1383.  
  1384.  ListType CEXTREMES( CurveType Crv, NumericType Epsilon, NumericType Axis )
  1385.  
  1386.    Computes the extreme set of the given Crv in the given axis (1 for X,
  1387.  2 for Y, 3 for Z). Since this computation is numeric, an Epsilon is
  1388.  also required to specify the desired tolerance. It returns a list of
  1389.  all the parameter values (NumericType) in which the curve takes an extreme
  1390.  value.
  1391.  
  1392.  Example:
  1393.  
  1394.     extremes = CEXTREMES( Crv, 0.0001, 1 );
  1395.  
  1396.  Computes the extreme set of curve crv, in the X axis, with
  1397.  error tolerance of 0.0001. See also CZERO.
  1398. $
  1399.  
  1400. CINFLECT
  1401.  
  1402.  ListType CINFLECT( CurveType Crv, NumericType Epsilon )
  1403.  
  1404.  or
  1405.  
  1406.  CurveType CINFLECT( CurveType Crv, NumericType Epsilon )
  1407.  
  1408.    Computes the inflection points of Crv in the XY plane.
  1409.  Since this computation is numeric, an Epsilon is also required
  1410.  to specify the desired tolerance. It returns a list of all the
  1411.  parameter values (NumericType) in which the curve has an inflection point.
  1412.    If, however, Epsilon is negative, a scalar field curve representing
  1413.  the sign of the curvature of the curve is returned instead.
  1414.  
  1415.  The sign of curvature scalar field is equal to
  1416.  
  1417.        s(t) = x' y'' - x'' y' 
  1418.  
  1419.  Example:
  1420.  
  1421.     inflect = CINFLECT( crv, 0.001 );
  1422.     pt_inflect = nil();
  1423.     pt = nil();
  1424.     for ( i = 1, 1, sizeof( inflect ),
  1425.             pt = ceval( crv, nth( inflect, i ) ):
  1426.             snoc( pt, pt_inflect )
  1427.         );
  1428.     interact( list( axes, crv, pt_inflect ), 0);
  1429.  
  1430.  Computes the set of inflection points of curve crv with error
  1431.  tolerance of 0.001. This set is then scanned in a loop and
  1432.  evaluated to the curve's locations which are then displayed with the crv.
  1433.  See also CZEROS, CEXTREMES, and CCRVTR.
  1434. $
  1435.  
  1436. CINTERP
  1437.  
  1438.  CurveType CINTERP( ListType PtList, NumericType Order, NumericType Size,
  1439.                                      ConstantType Param, NumericType Periodic)
  1440.  
  1441.    Computes a Bspline polynomial curve that interpolates or approximates
  1442.  the list of points in PtList. The Bspline curve will have order
  1443.  Order and Size control points, and will be periodic if
  1444.  periodic is none zero. The knots will be spaced according to
  1445.  Param which can be one of PARAM_UNIFORM, PARAM_CHORD or
  1446.  PARAM_CENTRIP. The former prescribes a uniform knot sequence and the
  1447.  latters specify knot spacing according to the chord
  1448.  length and a square root of the chord length. A periodic curve will be
  1449.  coerced to have PARAM_UNIFORM knot sequence.
  1450.    Use of Periodic end conditions can create cases with degenerated
  1451.  linear systems (determinant equal zero).  Increase or decrease of the
  1452.  Order of the Bspline by one will resolve the problem.
  1453.    All points in PtList must be of type (E1-E5, P1-P5) control point,
  1454.  or regular PointType. If Size is equal to the number of points in
  1455.  PtList the resulting curve will interpolate the data set.
  1456.  Otherwise, if Size is less than the number of points in PtList
  1457.  the point data set will be least square approximated. In no time can Size
  1458.  be lower than Order. Size of zero forces interpolation by
  1459.  setting Size to the data set size.
  1460.    All interior knots will be distinct preserving maximal continuity.
  1461.  The resulting Bspline curve will have open end conditions.
  1462.  
  1463.  Example:
  1464.  
  1465.     pl = nil();
  1466.     for ( x = 0, 1, 100,
  1467.           snoc(point(cos(x / 5), sin(x / 5), x / 50 - 1), pl)
  1468.     );
  1469.     c = CINTERP( pl, 3, 21, PARAM_UNIFORM );
  1470.  
  1471.  Samples a helical curve at 100 points and least square fit a quadratic
  1472.  Bspline curve with 21 point to the data set. The curve will have a uniform
  1473.  knot spacing.
  1474. $
  1475.  
  1476. CIRCLE
  1477.  
  1478.  CurveType CIRCLE( VectorType Center, NumericType Radius )
  1479.  
  1480.    Constructs a circle at the specified Center with the specified
  1481.  Radius. The returned circle is a Bspline curve of four piecewise Bezier
  1482.  90 degree arcs. The construced circle is always parallel to the XY plane.
  1483.  Use the linear transformation routines to place the circle in the appropriate
  1484.  orientation and location.
  1485. $
  1486.  
  1487. CIRCPOLY
  1488.  
  1489.  PolygonType CIRCPOLY( VectorType Normal, VectorType Trans, NumericType Radius )
  1490.  
  1491.    Defines a circular polygon in a plane perpendicular to Normal that
  1492.  contains the Trans point. Constructed polygon is centered at
  1493.  Trans. RESOLUTION vertices will be defined with Radius from
  1494.  distance from Trans.
  1495.  
  1496.    Alternative ways to construct a polygon are manual construction of the
  1497.  vertices using POLY, or the construction of a flat ruled surface using
  1498.  RULEDSRF.
  1499. $
  1500.  
  1501. CLNTREAD
  1502.  
  1503.  AnyType CLNTREAD( NumericType Handler, NumericType Block )
  1504.  
  1505.    Reads one object from a communication channel of a client.
  1506.  Handler contains the index of the communication channel opened via
  1507.  CLNTEXEC. If no data is available in the communication channel, this
  1508.  function will block for at most Block millisecond until data is found
  1509.  or timeout occurs. In the latter, a single StringType object is returned
  1510.  with the content of "no data (timeout)".  See also CLNTWRITE, CLNTCLOSE,
  1511.  and CLNTEXEC.
  1512.  
  1513.  Example:
  1514.  
  1515.    h2 = clntexec( "xmtdrvs -s-" );
  1516.        .
  1517.        .
  1518.  
  1519.    Model = CLNTREAD( h2 );
  1520.        .
  1521.        .
  1522.  
  1523.    clntclose( h2,TRUE );
  1524.  
  1525.  reads one object from client through communication channel h2 and save it
  1526.  in variable Model.
  1527. $
  1528.  
  1529. CMESH
  1530.  
  1531.  CurveType CMESH( SurfaceType Srf, ConstantType Direction, NumericType Index )
  1532.  
  1533.    Returns a single ROW or COLumn as specified by the Direction and
  1534.  Index (base count is 0) of the control mesh of surface Srf.
  1535.  
  1536.    The returned curve will have the same knot vector as Srf in the
  1537.  appropriate direction. See also CSURFACE.
  1538.  
  1539.    This curve is not necessarily in the surface Srf.
  1540.  
  1541.  Example:
  1542.  
  1543.     Crv = CMESH( Srf, COL, 0 );
  1544.  
  1545.  extracts the first column of surface Srf as a curve. See also
  1546.  CSURFACE.
  1547. $
  1548.  
  1549. CMORPH
  1550.  
  1551.  CurveType CMORPH( CurveType Crv1, CurveType Crv2,
  1552.                    NumericType Method, NumericType Blend )
  1553.  
  1554.  or
  1555.  
  1556.  ListType CMORPH( CurveType Crv1, CurveType Crv2,
  1557.                   NumericType Method, NumericType Blend )
  1558.  
  1559.  Creates a new curve which is a metamorph of the two given curves.
  1560.  The two given curves must be compatible (see FFCOMPAT) before this blend
  1561.  is invoked. Very useful if a sequence that "morphs" one curve to another
  1562.  is to be created. Several methods of metamorphosis are supported according
  1563.  to the value of Method,
  1564.  
  1565.  
  1566.     0   Simple convex blend.
  1567.     1   Corner/Edge cutting scheme, scaled to same curve length.
  1568.     2   Corner/Edge cutting scheme, scaled to same bounding box.
  1569.     3   Same as 1 but with filtering out of tangencies.
  1570.     4   Same as 2 but with filtering out of tangencies.
  1571.     5   Multiresolution decompsition based metamorphosis. See CMULTRES.
  1572.  
  1573.  
  1574.    In Method 1, Blend is a number between zero (Crv1)
  1575.  and one (Crv2) defining the similarity to Crv1 and Crv2,
  1576.  respectively. A single curve is returned.
  1577.  
  1578.    In Methods 2 to 5, Blend is a step size for the
  1579.  metamorphosis operation and a whole list describing the entire
  1580.  metamorphosis operation is returned.
  1581.  
  1582.  Examples:
  1583.  
  1584.     for ( i = 0, 1, 300,
  1585.         c = CMORPH( crv1a, crv1b, 0, i / 300.0 ):
  1586.         color( c, yellow ):
  1587.         viewobj( c )
  1588.     );
  1589.    
  1590.     crvs = CMORPH( crv1a, crv1b, 2, 0.003 );
  1591.     snoc( crv1b, crvs );
  1592.     for ( i = 1, 1, sizeof( crvs ),
  1593.         c = nth( crvs, i ):
  1594.         color( c, yellow ):
  1595.         viewobj( c )
  1596.     );
  1597.  
  1598.     Turtle2 = ffmatch( Wolf, Turtle, 20, 100, 2, false, 2 );
  1599.     ffcompat( Wolf, Turtle2 );
  1600.     for ( i = 0, 1, 25,
  1601.         c = CMORPH( Wolf, Turtle2, 0, i / 25 ):
  1602.         color( c, yellow ):
  1603.         viewobj( c )
  1604.     );
  1605.  
  1606.  creates three metamorphosis animation sequences, one that is based on
  1607.  a convex blend, one that is based on corner/edge cutting scheme.
  1608.  See alost SMORPH, and a third that employs FFMATCH.
  1609. $
  1610.  
  1611. CMULTIRES
  1612.  
  1613.  ListType CMULTIRES( CurveType Crv, NumericType Discont )
  1614.  
  1615.    Computes a multiresolution decomposition of curve Crv using least
  1616.  squares approximation. The resulting list of curves describes an hierarchy
  1617.  of curves in linear subspaces of the space Crv was in that can be
  1618.  sum algebraically to form Crv. Each of the curves in the hierarchy
  1619.  is a least squares approximation of Crv in the subspace it is defined
  1620.  in. Discont is a boolean flat that controls the way tangent
  1621.  discontinuities are computed throughout the decomposition.
  1622.  
  1623.  Example:
  1624.  
  1625.     MRCrv = CMULTIRES( Animal, false );
  1626.  
  1627.     sum = nth( MRCrv, 1 );
  1628.     MRCrvs = list( sum * tx( 3.0 ) );
  1629.     for ( ( i = 2 ), 1, sizeof( MRCrv ),
  1630.         sum = symbsum( sum, nth( MRCrv, i ) ):
  1631.         snoc( sum * tx( ( 3 - i ) * 1.5 ), MRCrvs )
  1632.     );
  1633.  
  1634.     All = MRCrvs * sc ( 0.25 );
  1635.     view( All, on );
  1636.  
  1637.  Computes a multiresolution decomposition to curve CrossSec as
  1638.  MRCrv and display all the decomposition levels by summing them all
  1639.  up. The use of none as on object name allows one to display an
  1640.  object in the display device without replacing the previous object in the
  1641.  display device, carrying the same name.
  1642.  
  1643.  creates two metamorphosis animation sequences, one that is based on
  1644.  a convex blend and one that is based on corner/edge cutting scheme.
  1645. $
  1646.  
  1647. CNORMAL
  1648.  
  1649.  VectorType CNORMAL( CurveType Crv, NumericType TParam )
  1650.  
  1651.    Computes the normal vector to curve Crv at the
  1652.  parameter values TParam. The returned vector has a
  1653.  unit length.
  1654.  
  1655.  Example:
  1656.  
  1657.     Normal = CNORMAL( Crv, 0.5 );
  1658.  
  1659.  computes the normal to Crv at the parameter value 0.5.
  1660.  See also CNRMLCRV.
  1661. $
  1662.  
  1663. CNRMLCRV
  1664.  
  1665.  CurveType CNRMLCRV( CurveType Crv )
  1666.  
  1667.  Symbolically computes a vector field curve representing the non-normalized
  1668.  normals of the given curve. That is a normal vector filed, evaluated at
  1669.  t, provides a vector in the direction of the normal of the original
  1670.  curve at t. The normal curve computed is in fact equal to kN where k
  1671.  is the curvature of Crv and N is its normal.
  1672.  
  1673.  Example:
  1674.  
  1675.  NrmlCrv = CNRMLCRV( Crv );
  1676. $
  1677.  
  1678. COERCE
  1679.  
  1680.  AnyType COERCE( AnyType Object, ConstantType NewType )
  1681.  
  1682.    Provides a coercion mechanism between different objects or object types.
  1683.  PointType, VectorType, PlaneType, CtlPtType can be all coerced to each
  1684.  other by using the NewType of POINT_TYPE, VECTOR_TYPE, PLANE_TYPE,
  1685.  or one of E1-E5, P1-P5 (CtlPtType). Similarly, CurveType, SurfaceType,
  1686.  TrimSrfType, and TrivarType can all be coerced to hold different
  1687.  CtlPtType of control points, or even different open end conditions from
  1688.  KV_PERIODIC to KV_FLOAT to KV_OPEN.
  1689.    If a scalar (E1 or P1) curve is coerced to E2 or P2 curve or
  1690.  a scalar (E1 or P1) surface is coerced to E3 or P3 surface, the Y (YZ)
  1691.  coordinate(s) is (are) updated to hold the parametric domain of the curve
  1692.  (surface).
  1693.  
  1694.  Example:
  1695.  
  1696.     CrvE2 = COERCE( Crv, E2 );
  1697.  
  1698.  coerce Crv to a new curve that will have an E2 CtlPtType control
  1699.  points. Coerction of a projective curve (P1-P5) to a Euclidean curve
  1700.  (E1-E5) does not preseve the shape of the curve.
  1701. $
  1702.  
  1703. COMPOSE
  1704.  
  1705.  CurveType COMPOSE( CurveType Crv1, CurveType Crv2 )
  1706.  
  1707.  or
  1708.  
  1709.  CurveType COMPOSE( SurfaceType Srf, CurveType Crv )
  1710.  
  1711.    Symbolically compute the composition curve Crv1(Crv2(t)) or
  1712.  Srf(Crv(t)). In Crv1(Crv2(t), Crv1 can be any curve
  1713.  while Crv2 must be a one-dimensional curve that is either E1 or
  1714.  P1. In Srf(Crv(t)), Srf can be any surface, while Crv
  1715.  must be a two-dimensional curve, that is either E2 or P2. Both Crv2
  1716.  in the curve's composition, and Crv is the surface's composition
  1717.  must be contained in the curve or surface parametric domain.
  1718.  
  1719.  Example:
  1720.  
  1721.    srf = sbezier( list( list( ctlpt( E3, 0.0, 0.0, 0.0 ),
  1722.                               ctlpt( E3, 0.0, 0.5, 1.0 ),
  1723.                               ctlpt( E3, 0.0, 1.0, 0.0 ) ),
  1724.                         list( ctlpt( E3, 0.5, 0.0, 1.0 ),
  1725.                               ctlpt( E3, 0.5, 0.5, 0.0 ),
  1726.                               ctlpt( E3, 0.5, 1.0, 1.0 ) ),
  1727.                         list( ctlpt( E3, 1.0, 0.0, 1.0 ),
  1728.                               ctlpt( E3, 1.0, 0.5, 0.0 ),
  1729.                               ctlpt( E3, 1.0, 1.0, 1.0 ) ) ) );
  1730.    crv = coerce( circle( vector( 0.0, 0.0, 1.0 ), 0.4 ), p2 ) *
  1731.          trans( vector( 0.5, 0.5, 0.0 ) );
  1732.    comp_crv = COMPOSE( srf, crv );
  1733.  
  1734.  compose a circle Crv to be on the surface Srf.
  1735. $
  1736.  
  1737. CON2
  1738.  
  1739.  PolygonType CON2( VectorType Center, VectorType Direction,
  1740.                    NumericType Radius1, NumericType Radius2 )
  1741.  
  1742.    Creates a truncated CONE geometric object, defined by Center as the
  1743.  center of the main base of the CONE, Direction as both the CONE's axis
  1744.  and the length of CONE, and the two radii Radius1/2 of the two bases of
  1745.  the CONE.
  1746.  
  1747.    Unlike the regular cone (CONE) constructor which has inherited
  1748.  discontinuities in its generated normals at the apex, CON2 can be used to
  1749.  form a (truncated) cone with continuous normals. 
  1750.    See RESOLUTION for the accuracy of the CON2 approximation as a polygonal
  1751.  model.
  1752.  
  1753.  Example:
  1754.  
  1755.     Cone2 = CON2( vector( 0, 0, -1 ), vector( 0, 0, 4 ), 2, 1 );
  1756.  
  1757.  constructs a truncated cone with bases parallel to the XY plane at
  1758.  Z = -1 and Z = 3, and with radii of 2 and 1 respectively.
  1759. $
  1760.  
  1761. CONE
  1762.  
  1763.  PolygonType CONE( VectorType Center, VectorType Direction,
  1764.                    NumericType Radius )
  1765.  
  1766.    Creates a CONE geometric object, defined by Center as the center of
  1767.  the base of the CONE, Direction as the CONE's axis and height, and
  1768.  Radius as the radius of the base of the CONE.
  1769.    See RESOLUTION for accuracy of the CONE approximation as a polygonal model. 
  1770.  
  1771.  Example:
  1772.  
  1773.     Cone1 = CONE( vector( 0, 0, 0 ), vector( 1, 1, 1 ), 1 );
  1774.  
  1775.  constructs a cone based in an XY parallel plane, centered at the origin
  1776.  with radius 1 and with tilted apex at ( 1, 1, 1 ).
  1777.  
  1778.    See also CON2.
  1779. $
  1780.  
  1781. CONTOUR
  1782.  
  1783.  PolygonType CONTOUR( SurfaceType ContouredSrf, PlaneType ContourPlane )
  1784.  
  1785.  or
  1786.  
  1787.  PolygonType CONTOUR( SurfaceType ContouredSrf, PlaneType ContourPlane,
  1788.                       SurfaceType MappedSrf )
  1789.  
  1790.    Contours surface ContouredSrf by intersecting plane ContourPlane
  1791.  with a polygonal approximating of ContouredSrf with resolution set
  1792.  via variable RESOLUTION.
  1793.    If ContouredSrf is a scalar field surface of type E1 or P1 and
  1794.  MappedSrf is provided, ContouredSrf is contoured above its
  1795.  parametric domain (U is X, V is Y) and the resulting parametric curve
  1796.  is composed with MappedSrf to yield the returned value.
  1797.  
  1798.  Example:
  1799.  
  1800.  resolution = 20;
  1801.  nglass = snrmlsrf( glass ) * vector( 1, 1, 1 );
  1802.  
  1803.  sils = contour( nglass, plane( 1, 0, 0, 0 ), glass );
  1804.  color( sils, cyan );
  1805.  attrib( sils, "dwidth", 4 );
  1806.  
  1807.  view( list( axes, glass, sils ), on );
  1808.  
  1809.  Computes the normal field of the surface glass, project it onto
  1810.  the viewing direction of (1, 1, 1) and contour the resulting scalar field
  1811.  with the plane X = 0, to extract the silhouette curves from viewing direction
  1812.  (1, 1, 1).
  1813. $
  1814.  
  1815. CONVEX
  1816.  
  1817.  PolygonType CONVEX( PolygonType Object )
  1818.  
  1819.  or
  1820.  
  1821.  ListType CONVEX( ListType Object )
  1822.  
  1823.    Converts non-convex polygons in Object, into convex ones. New vertices
  1824.  are introduced into the polygonal data during this process. The Boolean
  1825.  operations require the input to have convex polygons only (although it may
  1826.  return non convex polygons...) and it automatically converts non-convex input
  1827.  polygons to convex ones, using this same routine.
  1828.  
  1829.    However, some external tools (like irit2ray and poly3d-h) require convex
  1830.  polygons. This function must be used on the objects to guarantee that
  1831.  only convex polygons are saved into data files for these external tools.
  1832.  
  1833.  Example:
  1834.  
  1835.     CnvxObj = CONVEX( Obj );
  1836.     save( "data", CnvxObj );
  1837.  
  1838.  converts non-convex polygons into convex ones, so that the data file can be
  1839.  used by external tools requiring convex polygons.
  1840. $
  1841.  
  1842. COORD
  1843.  
  1844.  AnyType COORD( AnyType Object, NumericType Index )
  1845.  
  1846.    Extracts an element from a given Object, at index Index. From
  1847.  a PointType, VectorType, PlaneType, CtlPtType and MatrixType, a NumericType
  1848.  is returned with Index 0 for the X axis, 1 for the Y axis etc.
  1849.  Index 0 denotes the weight of CtlPtType. For a PolygonType that
  1850.  contains more than one polygon, the Indexth polygon is returned. For
  1851.  a PolygonType that contains a single Polygon, the Indexth vertex is
  1852.  returned. For a CurveType or a SurfaceType, the Indexth CtlPtType is
  1853.  returned. For a ListType, COORD behaves like NTH and returns the Indexth
  1854.  object in the list. For a StringType, the Indexth character is returned
  1855.  as its ASCII numeric code.
  1856.  
  1857.  Example:
  1858.  
  1859.     a = vector( 1, 2, 3 );
  1860.     vector( COORD( a, 0 ), COORD( a, 1 ), COORD( a, 2 ) );
  1861.  
  1862.     a = ctlpt( P2, 6, 7, 8, 9 );
  1863.     ctlpt( P3, coord( a, 0 ), coord( a, 1 ), coord( a, 2 ), coord( a, 3 ) );
  1864.  
  1865.     a = plane( 10, 11, 12, 13 );
  1866.     plane( COORD( a, 0 ), COORD( a, 1 ), COORD( a, 2 ), COORD( a, 3 ) );
  1867.  
  1868.  constructs a vector/ctlpt/plane and reconstructs it by extracting the
  1869.  constructed scalar components of the objects using COORD.
  1870.  
  1871.    See also COERCE.
  1872. $
  1873.  
  1874. CRAISE
  1875.  
  1876.  CurveType CRAISE( CurveType Curve, NumericType NewOrder )
  1877.  
  1878.    Raise Curve to the NewOrder Order specified.
  1879.  
  1880.  Example:
  1881.  
  1882.     Crv = cbezier( list( ctlpt( E2, -0.7,  0.3 ),
  1883.                          ctlpt( E2,  0.0,  1.0 ),
  1884.                          ctlpt( E2,  0.7,  0.0 ) ) );
  1885.     Crv2 = CRAISE( Crv, 5 );
  1886.  
  1887.  raises the 90 degrees corner Bezier curve Crv to be a quartic.
  1888. $
  1889.  
  1890. CREFINE
  1891.  
  1892.  CurveType CREFINE( CurveType Curve, NumericType Replace, ListType KnotList )
  1893.  
  1894.    Provides the ability to Replace a knot vector of Curve, or refine 
  1895.  it. KnotList is a list of knots to refine Curve at. All knots
  1896.  should be contained in the parametric domain of the Curve. If the knot
  1897.  vector is replaced, the length of KnotList should be identical to the
  1898.  length of the original knot vector of the Curve. If Curve is a
  1899.  Bezier curve, it is automatically promoted to be a Bspline curve.
  1900.  
  1901.  Example:
  1902.  
  1903.     Crv2 = CREFINE( Crv, FALSE, list( 0.25, 0.5, 0.75 ) );
  1904.  
  1905.  refines Crv and adds three new knots at 0.25, 0.5, and 0.75.
  1906. $
  1907.  
  1908. CREGION
  1909.  
  1910.  CurveType CREGION( CurveType Curve, NumericType MinParam,
  1911.                                                        NumericType MaxParam )
  1912.  
  1913.    Extracts a region from Curve between MinParam and MaxParam.
  1914.  Both MinParam and MaxParam should be contained in the
  1915.  parametric domain of the Curve.
  1916.  
  1917.  Example:
  1918.  
  1919.     SubCrv = CREGION( Crv, 0.3, 0.6 );
  1920.  
  1921.  extracts the region from Crv from the parameter value 0.3 to the
  1922.  parameter value 0.6.
  1923. $
  1924.  
  1925. CREPARAM
  1926.  
  1927.  CurveType CREPARAM( CurveType Curve, NumericType MinParam,
  1928.                                                        NumericType MaxParam )
  1929.  
  1930.    Reparametrize Curve over a new domain from MinParam to MaxParam.
  1931.  This operation does not affect the geometry of the curve and only affine
  1932.  transforms its knot vector. A Bezier curve will automatically be promoted
  1933.  into a Bspline curve by this function.
  1934.  
  1935.  Example:
  1936.  
  1937.     arc1 = arc( vector( 0.0, 0.0, 0.0 ),
  1938.                 vector( 0.5, 2.0, 0.0 ),
  1939.                 vector( 1.0, 0.0, 0.0 ) );
  1940.     crv1 = arc( vector( 1.0, 0.0, 0.75 ),
  1941.                 vector( 0.75, 0.0, 0.7 ),
  1942.                 vector( 0.5,  0.0, 0.85 ) ) +
  1943.            arc( vector( 0.5,  0.0, 0.75 ),
  1944.                 vector( 0.75, 0.0, 0.8 ),
  1945.                 vector( 1.0,  0.0, 0.65 ) );
  1946.  
  1947.     arc1 = CREPARAM( arc1, 0, 10 );
  1948.     crv1 = CREPARAM( crv1, 0, 10 );
  1949.  
  1950.  Sets the domain of the given two curves to be from zero to ten. The
  1951.  Bezier curve arc1 is promoted to a Bspline curve.
  1952. $
  1953.  
  1954. CROSSEC
  1955.  
  1956.  PolygonType CROSSEC( PolygonType Object )
  1957.  
  1958.    This feature is NOT implemented.
  1959. $
  1960.  
  1961. CRVLNDST
  1962.  
  1963.  NumericType CRVLNDST( CurveType Crv, PointType PtOnLine, VectorType LnDir,
  1964.                                  NumericType IsMinDist, NumericType Epsilon )
  1965.  
  1966.  or
  1967.  
  1968.  ListType CRVLNDST( CurveType Crv, PointType PtOnLine, VectorType LnDir,
  1969.                                 NumericType IsMinDist, NumericType Epsilon )
  1970.  
  1971.    Computes the closest (if IsMinDist is TRUE, farthest if FALSE) point
  1972.  on Curve to the line specified by PtOnLine and LnDir as a
  1973.  point on the line and a line direction.
  1974.    Since this operation is partially numeric, Epsilon is used to set
  1975.  the needed accuracy. It returns the parameter value of the location on
  1976.  Crv closest to the line.
  1977.    If, however, Epsilon is negative, -Epsilon is used instead,
  1978.  and all local extrema in the distance function are returned as a list
  1979.  (both minima and maxima).
  1980.    If the line and the curve intersect, the point of intersection is
  1981.  returned as the minimum.
  1982.  
  1983.  Example:
  1984.  
  1985.     Param = CRVLNDST( Crv, linePt, lineVec, TRUE, 0.001 );
  1986.  
  1987.  finds the closest point on Crv to the line defined by linePt
  1988.  and lineVec.
  1989. $
  1990.  
  1991. CRVPTDST
  1992.  
  1993.  NumericType CRVPTDST( CurveType Crv, PointType Point, NumericType IsMinDist,
  1994.                                                          NumericType Epsilon )
  1995.  
  1996.  or
  1997.  
  1998.  ListType CRVPTDST( CurveType Crv, PointType Point, NumericType IsMinDist,
  1999.                                                          NumericType Epsilon )
  2000.  
  2001.    Computes the closest (if IsMinDist is TRUE, farthest if FALSE) point
  2002.  on Crv to Point.
  2003.    Since this operation is partially numeric, Epsilon is used to set
  2004.  the needed accuracy. It returns the parameter value of the location on
  2005.  Crv closest to Point.
  2006.    If, however, Epsilon is negative, -Epsilon is used instead,
  2007.  and all local extrema in the distance function are returned as a list
  2008.  (both minima and maxima).
  2009.  
  2010.  Example:
  2011.  
  2012.     Param = CRVPTDST( Crv, Pt, FALSE, 0.0001 ); 
  2013.  
  2014.  finds the farthest point on Crv from point Pt.
  2015. $
  2016.  
  2017. CSURFACE
  2018.  
  2019.  CurveType CSURFACE( SurfaceType Srf, ConstantType Direction,
  2020.                                                           NumericType Param )
  2021.  
  2022.    Extract an isoparametric curve out of Srf in the specified
  2023.  Direction (ROW or COL) at the specified parameter value Param.
  2024.  Param must be contained in the parametric domain of Srf in
  2025.  Direction direction.
  2026.  The returned curve is in the surface Srf.
  2027.  
  2028.  Example:
  2029.  
  2030.     Crv = CSURFACE( Srf, COL, 0.45 ); 
  2031.  
  2032.  extracts an isoparametric curve in the COLumn direction at the parameter
  2033.  value of 0.15 from surface Srf. See also CMESH, COMPOSE.
  2034. $
  2035.  
  2036. CTANGENT
  2037.  
  2038.  VectorType CTANGENT( CurveType Curve, NumericType Param )
  2039.  
  2040.    Computes the tangent vector to Curve at the parameter value Param.
  2041.    The returned vector has a unit length.
  2042.  
  2043.  Example:
  2044.  
  2045.     Tang = CTANGENT( Crv, 0.5 );
  2046.  
  2047.  computes the tangent vector to Crv at the parameter value of 0.5.
  2048. $
  2049.  
  2050. CTLPT
  2051.  
  2052.  CPt = CTLPT( ConstantType PtType, NumericType Coord1, ... )
  2053.  
  2054.    Constructs a single control point to be used in the construction of curves
  2055.  and surfaces. Points can have from one to five dimensions, and may be
  2056.  either Euclidean or Projective (rational). Points' type is set via the
  2057.  constants E1 to E5 and P1 to P5. The coordinates of the point are specified
  2058.  in order, weight is first if rational.
  2059.  
  2060.  Examples:
  2061.  
  2062.     CPt1 = CTLPT( E3, 0.0, 0.0, 0.0 );
  2063.     CPt2 = CTLPT( P2, 0.707, 0.707, 0.707 );
  2064.  
  2065.  constructs an E3 point at the origin and a P2 rational point with
  2066.  a weight of 0.707. The Projective Pi points are specified as
  2067.  CTLPT(Pn, W, W X1, ... , W Xn).
  2068. $
  2069.  
  2070. CTRIMSRF
  2071.  
  2072.  ListType CTRIMSRF( TrimSrfType TSrf, NumericType Parametric )
  2073.  
  2074.    Extract the trimming curves of a trimmed surface TSrf.
  2075.  If Parametric is not zero, then the trimming curves are extracted
  2076.  as parametric space curves of TSrf. Otherwise, the trimming curves
  2077.  are evaluated into Euclidean space as curves on surface TSrf.
  2078.  
  2079.  Example:
  2080.  
  2081.     TrimCrvs = CTRIMSRF( TrimSrf, FALSE ); 
  2082.  
  2083.  extracts the trimming curves of TrimSrf as Euclidean curves on
  2084.  TrimSrf.
  2085. $
  2086.  
  2087. CYLIN
  2088.  
  2089.  PolylineType CYLIN( VectorType Center, VectorType Direction,
  2090.                      NumericType Radius )
  2091.  
  2092.    Creates a CYLINder geometric object, defined by Center as center of
  2093.  the base of the CYLINder, Direction as the CYLINder's axis and height,
  2094.  and Radius as the radius of the base of the CYLINder.
  2095.    See RESOLUTION for the accuracy of the CYLINder approximation as a
  2096.  polygonal model.
  2097.  
  2098.  Example:
  2099.  
  2100.     Cylinder1 = CYLIN( vector( 0, 0, 0 ), vector( 1, 0, 0 ), 10 );
  2101.  
  2102.  constructs a cylinder along the X axis from the origin to X = 10.
  2103. $
  2104.  
  2105. CZEROS
  2106.  
  2107.  ListType CZEROS( CurveType Crv, NumericType Epsilon, NumericType Axis )
  2108.  
  2109.    Computes the zero set of the given Crv in the given axis (1 for X,
  2110.  2 for Y, 3 for Z). Since this computation is numeric, an Epsilon is
  2111.  also required to specify the desired tolerance. It returns a list of
  2112.  all the parameter values (NumericType) the curve is zero.
  2113.  
  2114.  Example:
  2115.  
  2116.     xzeros = CZEROS( cb, 0.001, 1 );
  2117.     pt_xzeros = nil();
  2118.     pt = nil();
  2119.     for ( i = 1, 1, sizeof( xzeros ),
  2120.             pt = ceval( cb, nth( xzeros, i ) ):
  2121.             snoc( pt, pt_xzeros )
  2122.         );
  2123.     interact( list( axes, cb, pt_xzeros ), 0 );
  2124.  
  2125.  Computes the X zero set of curve cb with error tolerance
  2126.  of 0.001. This set is then scanned in a loop and evaluated to
  2127.  the curve's locations, which are then displayed.
  2128.  See also CINFLECT.
  2129. $
  2130.  
  2131. EVOLUTE
  2132.  
  2133.  CurveType EVOLUTE( CurveType Curve )
  2134.  
  2135.  or
  2136.  
  2137.  SurfaceType EVOLUTE( SurfaceType Curve )
  2138.  
  2139.    Computes the evolute of a curve or a surface.
  2140.  For curves, the evolute is defined as,
  2141.  
  2142.                N(t)
  2143.  E(t) = C(t) + ----
  2144.                k(t)
  2145.  
  2146.  where N(t) is the unit normal of C(t) and k(t) is its curvature.
  2147.  E(t) is computed symbolically as the symbolic sum of C(t) and
  2148.  N(t) / k(t).
  2149.  For surfaces, this function computes the mean evulate which is equal to,
  2150.  
  2151.                       n(u, v)
  2152.  E(u, v) = S(u, v) + ---------
  2153.                      2 H(u, v)
  2154.  
  2155.  where n(u, v) is the unit normal of S(u, v) and H(u, v) is its mean
  2156.  curvature. E(u, v) is computed symbolically.
  2157.  
  2158.  The result of this symbolic computation is exact (upto machine precision)
  2159.  unlike a similar operations that are only approximated, like the OFFSET or
  2160.  the AOFFSET.
  2161.  
  2162.  Example:
  2163.  
  2164.     crv = cbspline( 3,
  2165.                     list( ctlpt( E3, -1.0,  0.1,  0.2 ),
  2166.                           ctlpt( E3, -0.1,  1.0,  0.1 ),
  2167.                           ctlpt( E3,  0.1,  0.1,  1.0 ),
  2168.                           ctlpt( E3,  1.0,  0.1,  0.1 ),
  2169.                           ctlpt( E3,  0.1,  1.0,  0.2 ) ),
  2170.                     list( KV_OPEN ) );
  2171.     cev = EVOLUTE( Crv );
  2172. $
  2173.  
  2174. EXTRUDE
  2175.  
  2176.  PolygonType EXTRUDE( PolygonType Object, VectorType Dir )
  2177.  
  2178.  or
  2179.  
  2180.  SurfaceType EXTRUDE( CurveType Object, VectorType Dir )
  2181.  
  2182.    Creates an extrusion of the given Object. If Object is a
  2183.  PolygonObject, its first polygon is used as the base for the extrusion in
  2184.  Dir direction, and a closed PolygonObject is constructed. If Object
  2185.  is a CurveType, an extrusion surface is constructed instead, which is not
  2186.  a closed object (the two bases of the extrusion are excluded, and the curve
  2187.  may be open by itself).
  2188.  
  2189.    Direction Dir cannot be coplanar with the polygon plane. The curve
  2190.  may be nonplanar.
  2191.  
  2192.  Example:
  2193.  
  2194.     Cross = cbspline( 3,
  2195.                       list( ctlpt( E2, -0.018, 0.001 ),
  2196.                             ctlpt( E2,  0.018, 0.001 ),
  2197.                             ctlpt( E2,  0.019, 0.002 ),
  2198.                             ctlpt( E2,  0.018, 0.004 ),
  2199.                             ctlpt( E2, -0.018, 0.004 ),
  2200.                             ctlpt( E2, -0.019, 0.001 ) ),
  2201.                       list( KV_OPEN ) );
  2202.     Cross = Cross + -Cross * scale( vector( 1, -1, 1 ) );
  2203.     Napkin = EXTRUDE( Cross * scale( vector( 1.6, 1.6, 1.6 ) ),
  2204.                       vector( 0.02, 0.03, 0.2 ) );
  2205.  
  2206.  constructs a closed cross section Cross by duplicating one half of
  2207.  it in reverse and merging the two sub-curves. Cross is then used as
  2208.  the cross-section for the extrusion operation.
  2209. $
  2210.  
  2211. FFCOMPAT
  2212.  
  2213.  FFCOMPAT( CurveType Crv1, CurveType Crv2 )
  2214.  
  2215.  or
  2216.  
  2217.  FFCOMPAT( SurfaceType Srf1, SurfaceType Srf2 )
  2218.  
  2219.  Makes the given two curves or surfaces compatible by making them share the
  2220.  same point type, same curve type, same degree, and the same continuity.
  2221.  Same point type is gained by promoting a lower dimension into a higher one,
  2222.  and non-rational to rational points. Bezier curves are promoted to Bspline
  2223.  curves if necessary, for curve type compatibility. Degree compatibility is
  2224.  achieved by raising the degree of the lower order curve. Continuity is
  2225.  achieve by refining both curves to the space with the same (unioned) knot
  2226.  vector. This function returns nothing and compatibility is made
  2227.  in place.
  2228.  
  2229.  Example:
  2230.  
  2231.  FFCOMPAT( Srf1, Srf2 );
  2232.  
  2233.  See also CMORPH and SMORPH.
  2234. $
  2235.  
  2236. FFEXTREME
  2237.  
  2238.  CtlPtType FFEXTREME( CurveType Crv, NumericType Minimum )
  2239.  
  2240.  or
  2241.  
  2242.  CtlPtType FFEXTREME( SurfaceType Srf, NumericType Minimum )
  2243.  
  2244.  Computes a bound on the extreme values a curves Crv or surface
  2245.  Srf can assume. Returned control points provides a bound on the
  2246.  minimum (maximum) values that can be assumed if Minimum is TRUE
  2247.  (FALSE).
  2248.  
  2249.  Example:
  2250.  
  2251.  Bound = FFEXTREME( Srf, false );
  2252.  
  2253.  Computes a bound on the maximal values Srf can assume.
  2254. $
  2255.  
  2256. FFMATCH
  2257.  
  2258.  FFMATCH( CurveType Crv1, CurveType Crv2, NumericType Reduce,
  2259.           NumericType Samples, NumericType ReparamOrder,
  2260.           NumericType Rotate, NumericType NormType )
  2261.  
  2262.  Computes a reparametrization to Crv2 so it fits Crv1, the best
  2263.  under some prescribed norm, NormType. Currently the following norms
  2264.  are valid for NormType
  2265.  
  2266.     Value      Description
  2267.     1          Suitable for ruled and blended curves, for modeling.
  2268.                See RULEDSRF.
  2269.     2          Suitable for metamorphosis of curves. See CMORPH.
  2270.     3          Distance norm in "walking the dog" notion.
  2271.     4          Bisector (skeleton) matching norm for two curves.
  2272.  
  2273.  Whenever negative norms can result (for example, in cases were self
  2274.  intersection cannot be prevented in ruled surface constructions), one can
  2275.  allow negativity with no extra penalty by applaying neative NormType.
  2276.    Use of positive only norms would yield no output at all if no matching
  2277.  with positive weights can be established whereas allowing negative
  2278.  norm values would result in the globally optimal result, but with possibly
  2279.  self intersectiions.
  2280.  
  2281.  The reparametrization is computed by sampling a fix set of size Samples
  2282.  off both curves, and fitting a Bspline curve of length Reduce as the
  2283.  reparametrization curve. Hence, Reduce must be less than or equal to
  2284.  Samples. The reparametrization curve will have order of
  2285.  ReparamOrder. If Rotate is TRUE or ON, then attempt is made
  2286.  to rotate the reparametrization of the curves. Rotation can be used on
  2287.  closed curves only.
  2288.  
  2289.  See RULEDSRF and CMORPH for examples.
  2290. $
  2291.  
  2292. FFMERGE
  2293.  
  2294.  CurveType FFMERGE( ListType E1Curves, NumericType PointType )@
  2295.  
  2296.  or
  2297.  
  2298.  SurfaceType FFMERGE( ListType E1Surfaces, NumericType PointType )
  2299.  
  2300.  Merges the scalar curves in the list of curves E1Curves or list
  2301.  of surfaces E1Surfaces to one vector curve/surface of point type
  2302.  PointType.
  2303.  
  2304.  Example:
  2305.  
  2306.  Srf = FFMERGE( list( SrfW, SrfX, SrfY ), P2 );
  2307.  
  2308.  merges three scalar surfaces into a single surface with point type P2.
  2309.  See also FFSPLIT, FFPTTYPE.
  2310. $
  2311.  
  2312. FFPTTYPE
  2313.  
  2314.  NumericType FFMERGE( CurveType Crv )
  2315.  
  2316.  or
  2317.  
  2318.  NumericType FFMERGE( SurfaceType Srf )
  2319.  
  2320.  or
  2321.  
  2322.  NumericType FFMERGE( TrivarType )
  2323.  
  2324.  Returns the point type (E2, P4 etc.) of the given freeform.
  2325. $
  2326.  
  2327. FFSPLIT
  2328.  
  2329.  ListType FFSPLIT( CurveType Crv )
  2330.  
  2331.  or
  2332.  
  2333.  ListType FFSPLIT( SurfaceType Srf )
  2334.  
  2335.  Splits the given curve Crv or surface Srf into its scalar
  2336.  components that are returned as a list of curves/surfaces.
  2337.  
  2338.  Example:
  2339.  
  2340.  E1Srfs = FFSPLIT( circle( vector( 0, 0, 0 ), 1 ) );
  2341.  
  2342.  splits the circle which is a curve in P3 into four scalar curves (W, X, Y, Z)
  2343.  that are returned in a single list.
  2344.  See also FFMERGE, FFPTTYPE.
  2345. $
  2346.  
  2347. GBOX
  2348.  
  2349.  PolygonType GBOX( VectorType Point,
  2350.                    VectorType Dx, VectorType Dy, VectorType Dz )
  2351.  
  2352.    Creates a parallelepiped - Generalized BOX polygonal object, defined by
  2353.  Point as base position, and Dx, Dy, Dz as 3 3D vectors to define
  2354.  the 6 faces of this generalized BOX. The regular BOX object is a special case
  2355.  of GBOX where Dx = vector(Dx, 0, 0), Dy = vector(0, Dy, 0), and
  2356.  Dz = vector(0, 0, Dz).
  2357.  
  2358.    Dx, Dy, Dz must all be independent in order to create an
  2359.  object with positive volume.
  2360.  
  2361.  Example:
  2362.  
  2363.     GB = GBOX(vector(0.0, -0.35, 0.63), vector(0.5, 0.0, 0.5),
  2364.                                         vector(-0.5, 0.0, 0.5),
  2365.                                         vector(0.0, 0.7, 0.0));
  2366. $
  2367.  
  2368. GETLINE
  2369.  
  2370.  AnyType GETLINE( NumericType RequestedType )
  2371.  
  2372.    Provides a method to get input from keyboard within functions and
  2373.  or subroutines. RequestedType can be one of NUMERIC_TYPE,
  2374.  POINT_TYPE, VECTOR_TYPE, or PLANE_TYPE in which the entered line
  2375.  will be parsed into one, three, or four numeric values (sperated by
  2376.  either spaces or commas) and the proper object will be created and
  2377.  returned. In any other case, including failure to parse the numeric
  2378.  input, a STRING_TYPE object will be constructed from the entered line.
  2379.  
  2380.  Example:
  2381.  
  2382.     Pt = GETLINE( point_type );
  2383.  
  2384.  to read one point (three numeric values) from stdin.
  2385. $
  2386.  
  2387. GPOLYGON
  2388.  
  2389.  PolygonType GPOLYGON( GeometryTreeType Object, NumericType Normals )
  2390.  
  2391.    Approximates all Surface(s)/Trimmed surface(s)/Trivariate(s) in Object
  2392.  with polygons using the RESOLUTION and FLAT4PLY variables. The larger the
  2393.  RESOLUTION is, the finer (more polygons) the resulting approximation will be.
  2394.  
  2395.    FLAT4PLY is a Boolean flag controlling the conversion of an (almost) flat
  2396.  patch into four (TRUE) or two (FALSE) polygons. Normals are computed to
  2397.  polygon vertices using surface normals, so Gouraud or Phong shading can be
  2398.  exploited. It returns a single polygonal object.
  2399.  
  2400.    If Normals is set, surface normals will be evaluated at the
  2401.  vertices. Otherwise flat shading and constant normals across polygons are
  2402.  assumed.
  2403.  
  2404.  Example:
  2405.  
  2406.     Polys = GPOLYGON( list( Srf1, Srf2, Srf3 ), off );
  2407.  
  2408.  Converts to polygons the three surfaces Srf1, Srf2, and Srf3
  2409.  with no normals.
  2410. $
  2411.  
  2412. GPOLYLINE
  2413.  
  2414.  PolylineType GPOLYLINE( GeometryTreeType Object, NumericType Optimal )
  2415.  
  2416.    Converts all Curves(s), (Trimmed) Surface(s), and Trivariate(s) Object
  2417.  into polylines using the RESOLUTION variable. The larger the RESOLUTION is,
  2418.  the finer the resulting approximation will be. It returns a single polyline
  2419.  object.
  2420.  
  2421.    If Optimal is false, the points are sampled at equally spaced
  2422.  interval in the parametric space. If Optimal true, a better, more
  2423.  expensive computationally, algorithm is used to derive optimal sampling
  2424.  locations as to minimize the maximal distance between the curve and
  2425.  piecewise linear approximation (L infinity norm).
  2426.  
  2427.  Example:
  2428.  
  2429.     Polys = GPOLYLINE( list( Srf1, Srf2, Srf3, list( Crv1, Crv2, Crv3 ) ),
  2430.                        on );
  2431.  
  2432.  converts to polylines the three surfaces Srf1, Srf2, and Srf3
  2433.  and the three curves Crv1, Crv2, and Crv3.
  2434. $
  2435.  
  2436. HERMITE
  2437.     
  2438.  SurfaceType HERMITE( CurveType Bndry1, CurveType Bndry2,
  2439.                       CurveType Tan1, CurveType Tan2 )
  2440.  
  2441.  or
  2442.  
  2443.  CurveType HERMITE( PointType Bndry1, PointType Bndry2,
  2444.                     VectorType Tan1, VectorType Tan2 )
  2445.  
  2446.  Constructs a cubic fit between Bndry1 and Bndry2 so that
  2447.  first derivative continuity constraints, as prescribed by Tan1 at
  2448.  Bndry1 and Tan2 at Bndry2, are preserved.
  2449.  
  2450.  Returns either a curve or a surface, according to type of input parameters.
  2451.  
  2452.  Example:
  2453.  
  2454.     h00 = HERMITE( point( 0, 0, 0 ),
  2455.                    point( 1, 1, 0 ),
  2456.                    vector( 1, 0, 0 ),
  2457.                    vector( 1, 0, 0 ) );
  2458.  Constructs a curve in the shape of the first basis function of the cubic
  2459.  Hermite basis functions.
  2460. $
  2461.  
  2462. LOFFSET
  2463.     
  2464.  CurveType LOFFSET( CurveType Crv, NumericType OffsetDistance,
  2465.                     NumericType NumOfSamples, NumericType NumOfDOF,
  2466.                     NumericType Order )
  2467.  
  2468.  Approximate an offset of OffsetDistance by sampling NumOfSamples
  2469.  samples along the offset curve and least square fitting them using a Bspline
  2470.  curve of order Order and NumOfDOF control points.
  2471.  
  2472.  Example:
  2473.  
  2474.     OffCrv1 = LOFFSET( Crv, -0.4, 100, 10, 4 );
  2475.  See also OFFSET, AOFFSET, and MOFFSET.
  2476. $
  2477.  
  2478. MERGEPOLY
  2479.  
  2480.  PolygonType MERGEPOLY( ListType PolyList )
  2481.  
  2482.  Merges a set of polygonal objects in PolyList list to a single polygonal
  2483.  object. All elements in ObjectList must be of PolygonType type. This
  2484.  function performs the same operation as the overloaded ^ operator
  2485.  would, but might be more convenient to use under some circumstances.
  2486.  
  2487.  Example:
  2488.  
  2489.     Vrtx1 = vector( -3, -2, -1 );
  2490.     Vrtx2 = vector( 3, -2, -1 );
  2491.     Vrtx3 = vector( 3, 2, -1 );
  2492.     Vrtx4 = vector( -3, 2, -1 );
  2493.     Poly1 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false ); 
  2494.     
  2495.     Vrtx1 = vector( -3, 2, 1 );
  2496.     Vrtx2 = vector( 3, 2, 1 );
  2497.     Vrtx3 = vector( 3, -2, 1 );
  2498.     Vrtx4 = vector( -3, -2, 1 );
  2499.     Poly2 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false );
  2500.     
  2501.     Vrtx1 = vector( -3, -2, 1 );
  2502.     Vrtx2 = vector( 3, -2, 1 );
  2503.     Vrtx3 = vector( 3, -2, -1 );
  2504.     Vrtx4 = vector( -3, -2, -1 );
  2505.     Poly3 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false );
  2506.    
  2507.     PolyObj = MERGEPOLY( list( Poly1, Poly2, Poly3 ) );
  2508. $
  2509.  
  2510. MOFFSET
  2511.  
  2512.  CurveType MOFFSET( CurveType Crv, NumericType OffsetDistance,
  2513.                     NumericType AngularError )
  2514.  
  2515.  Computes an offset of OffsetDistance with globally bounded error
  2516.  (controlled by AngularError). The smaller AngularError is, the better
  2517.  the approximation to the offset. The bounded error is achieved by adaptive
  2518.  refinement of the Crv.
  2519.    The offset is computed via matching of the tangent fields of the
  2520.  given curve Crv and an arc spanning the same angular domain.
  2521.    Further, AngularError measures the angular deviation allowed
  2522.  between the two tangent fields.
  2523.  
  2524.  Example:
  2525.  
  2526.     OffCrv1 = MOFFSET( Crv, -0.4, 10 );
  2527.     OffCrv2 = MOFFSET( Crv, -0.4, 5 );
  2528.  
  2529.  computes an offset approximation to Crv with OffsetDistance of
  2530.  -0.4 and AngularError of 10 and 5 degrees, respectively.
  2531.  See also OFFSET, AOFFSET, LOFFSET, and FFMATCH.
  2532. $
  2533.  
  2534. MOMENT
  2535.     
  2536.  PointType MOMENT( CurveType Crv, 0 );
  2537.  
  2538.  or
  2539.  
  2540.  VectorType MOMENT( CurveType Crv, 1 );
  2541.  
  2542.  Approximates the zero and first moment of curve Crv.
  2543.  
  2544.  Example:
  2545.  
  2546.     a = circle( vector( 0, 0, 0 ), 1 );
  2547.     a = cregion( a, 0, 1 );
  2548.     p = moment( a, 0 );
  2549.     v = moment( a, 1 );
  2550.     view(list(a, p, v), on);
  2551.  
  2552.     a = cregion( a, 0, 1 ) * rz( 45 );
  2553.     p = moment( a, 0 );
  2554.     v = moment( a, 1 );
  2555.     view(list(a, p, v), on);
  2556.  
  2557.  computes and displays the zero and first moment of a quarter of a circle
  2558.  in two orientations.
  2559. $
  2560.  
  2561. NIL
  2562.  
  2563.  ListType NIL()
  2564.  
  2565.    Creates an empty list so data can be accumulated in it.
  2566.  See CINFLECT or CZEROS for examples. See also LIST and SNOC.
  2567. $
  2568.  
  2569. OFFSET
  2570.  
  2571.  CurveType OFFSET( CurveType Crv, NumericType OffsetDistance,
  2572.                    NumericType Tolerance, NumericType BezInterp )
  2573.  
  2574.  or
  2575.  
  2576.  SurfaceType OFFSET( SurfaceType Srf, NumericType OffsetDistance,
  2577.                      NumericType Tolerance, NumericType BezInterp )
  2578.  
  2579.  or
  2580.  
  2581.  TrimSrfType OFFSET( TrimSrfType TrimSrf, NumericType OffsetDistance,
  2582.                      NumericType Tolerance, NumericType BezInterp )
  2583.  
  2584.  Offsets Crv, Srf or a TrimSrf, by translating all the
  2585.  control points in the direction of the normal of the curve or the (trimmed)
  2586.  surface by an OffsetDistance amount.
  2587.    Each control point has a node parameter value associated with
  2588.  it, which is used to compute the normal. The returned curve or surface only
  2589.  approximates the real offset. If the resulting approximation does not satisfy
  2590.  the accuracy required by Tolerance, Crv or Srf or
  2591.  TrimSrf is subdivided and an offset approximation fit is computed to
  2592.  the two halfs. For curves, one can request a Bezier interpolation scheme in
  2593.  the offset approximation by setting BezInterp. The BezInterp is
  2594.  not supported yet for (trimmed) surfaces.
  2595.  Negative OffsetDistance denotes offset in the reversed direction of the
  2596.  normal.
  2597.  
  2598.  Example:
  2599.  
  2600.     OffCrv = OFFSET( Crv, -0.4, 0.1, off );
  2601.  
  2602.  offsets Crv by the amount of -0.4 in the reversed normal direction,
  2603.  Tolerance of 0.1 and no Bezier interpolation.
  2604.  See also AOFFSET and LOFFSET.
  2605. $
  2606.  
  2607. PCIRCLE
  2608.  
  2609.  CurveType PCIRCLE( VectorType Center, NumericType Radius )
  2610.  
  2611.  Same as CIRCLE but approximates the circle as a polynomial curve.
  2612.  See CIRCLE.
  2613. $
  2614.  
  2615. PDOMAIN
  2616.  
  2617.  ListType PDOMAIN( CurveType Crv )
  2618.  
  2619.  or
  2620.  
  2621.  ListType PDOMAIN( SurfaceType Srf )
  2622.  
  2623.  or
  2624.  
  2625.  ListType PDOMAIN( TrimSrfType TrimSrf )
  2626.  
  2627.  or
  2628.  
  2629.  ListType PDOMAIN( TrivarType TV )
  2630.  
  2631.    Returns the parametric domain of the curve (TMin, TMax) or of a (trimmed)
  2632.  surface (UMin, UMax, VMin, VMax) or of a trivariate function
  2633.  (UMin, UMax, VMin, VMax, WMin, WMax) as a list object.
  2634.  
  2635.  Example:
  2636.  
  2637.  circ_domain = PDOMAIN( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
  2638. $
  2639.  
  2640. PLN3PTS
  2641.  
  2642.  PlaneType PLN3PTS( PointType Pt1, PointType Pt2, PointType Pt3 )
  2643.  
  2644.    Computes a plane out of three points.
  2645.  
  2646.  Example:
  2647.  
  2648.  Pl1 = PLN3PTS( point( 0, 0, 0 ), point( 0, 1, 0 ), point( 1, 0, 0 ) );
  2649. $
  2650.  
  2651. POLY
  2652.  
  2653.  PolygonType POLY( ListType VrtxList, NumericType IsPolyline )
  2654.  
  2655.    Creates a single polygon/polyline (and therefore open) object, defined by
  2656.  the vertices in VrtxList (see LIST). All elements in VrtxList
  2657.  must be of VectorType type. If IsPolyline, a polyline is created,
  2658.  otherwise a polygon.
  2659.  
  2660.  Example:
  2661.  
  2662.     V1  = vector( 0.0, 0.0, 0.0 );
  2663.     V2  = vector( 0.3, 0.0, 0.0 );
  2664.     V3  = vector( 0.3, 0.0, 0.1 );
  2665.     V4  = vector( 0.2, 0.0, 0.1 );
  2666.     V5  = vector( 0.2, 0.0, 0.5 );
  2667.     V6  = vector( 0.3, 0.0, 0.5 );
  2668.     V7  = vector( 0.3, 0.0, 0.6 );
  2669.     V8  = vector( 0.0, 0.0, 0.6 );
  2670.     V9  = vector( 0.0, 0.0, 0.5 );
  2671.     V10 = vector( 0.1, 0.0, 0.5 );
  2672.     V11 = vector( 0.1, 0.0, 0.1 );
  2673.     V12 = vector( 0.0, 0.0, 0.1 );
  2674.     I = POLY( list( V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12 ),
  2675.               FALSE );
  2676.  
  2677.  constructs an object with a single polygon in the shape of the letter I.
  2678. $
  2679.  
  2680. PRISA
  2681.  
  2682.  ListType PRISA( SurfaceType Srfs, NumericType SamplesPerCurve,
  2683.                  NumericType Epsilon, ConstantType Dir, VectorType Space )
  2684.  
  2685.    Computes a layout (prisa) of the given surface(s) Srfs, and returns
  2686.  a list of surface objects representing the layout.
  2687.    The surface is approximated to within Epsilon in direction Dir
  2688.  into a set of ruled surfaces and then developable surfaces that are laid out
  2689.  flat onto the XY plane. If Epsilon is negative, the piecewise ruled
  2690.  surface approximation in 3-space is returned. 
  2691.    SamplesPerCurve controls the piecewise linear approximation of the
  2692.  boundary of the ruled/developable surfaces. Space is a vector whose
  2693.  X component controls the space between the different surfaces' layout, and
  2694.  whose Y component controls the space between different layout pieces.
  2695.  
  2696.  Example:
  2697.  
  2698.  cross = cbspline( 3,
  2699.                    list( ctlpt( E3, 0.7, 0.0, 0. ),
  2700.                          ctlpt( E3, 0.7, 0.0, 0.06 ),
  2701.                          ctlpt( E3, 0.1, 0.0, 0.1 ),
  2702.                          ctlpt( E3, 0.1, 0.0, 0.6 ),
  2703.                          ctlpt( E3, 0.6, 0.0, 0.6 ),
  2704.                          ctlpt( E3, 0.8, 0.0, 0.8 ),
  2705.                          ctlpt( E3, 0.8, 0.0, 1.4 ),
  2706.                          ctlpt( E3, 0.6, 0.0, 1.6 ) ),
  2707.                    list( KV_OPEN ) );
  2708.  wglass = surfrev( cross );
  2709.  wgl_ruled = PRISA( wglass, 6, -0.1, COL, vector( 0, 0.25, 0.0 ) );
  2710.  wgl_prisa = PRISA( wglass, 6, 0.1, COL, vector( 0, 0.25, 0.0 ) );
  2711.  
  2712.  Computes a layout of a wine glass in wgl_prisa and a three-dimensional
  2713.  ruled surface approximation of wglass in wgl_ruled.
  2714. $
  2715.  
  2716. PT3BARY
  2717.  
  2718.  VectorType PT3BARY( PointType Pt1, PointType Pt2, PointType Pt3,
  2719.                      PointType InteriorPt )
  2720.  
  2721.    Computes the barycentric coordinates of InterPt with respect
  2722.  to the triangle defined by Pt1, Pt2, Pt3.  Returned
  2723.  is a vector of three coefficents, which are the weights of the three
  2724.  points of the triangle. InteriorPt is assumed to be in the
  2725.  triangle.
  2726.  
  2727.  Example:
  2728.  
  2729.  Coeffs = PT3BARY( point( 0, 0, 0 ),
  2730.                    point( 1, 0, 0 ),
  2731.                    point( 0, 1, 0 ),
  2732.                    point( 0.25, 0.25, 0.0 ) );
  2733. $
  2734.  
  2735. PTLNPLN
  2736.  
  2737.  VectorType PTLNPLN( PointType LineOrig, VectorType LineRay, PlaneType Plane )
  2738.  
  2739.    Computes the point of intersection of given line LineOrig,
  2740.  LineRay with plane Plane.
  2741.  
  2742.  Example:
  2743.  
  2744.  InterPt = PtLnPln( point( 1, 0, 1 ), vector( 1, 1, 1 ), Plane( 0, 0, 1, 0 ) );
  2745. $
  2746.  
  2747. PTPTLN
  2748.  
  2749.  VectorType PTPTLN( PointType Point, PointType LineOrig, VectorType LineRay )
  2750.  
  2751.    Computes the point on line LineOrig, LineRay that is closest
  2752.  to point Point.  See also DSTPTLN
  2753.  
  2754.  Example:
  2755.  
  2756.  ClosestPt = PTPTLN( point( 0, 0, 0 ), point( 1, 1, 0 ), vector( 1, 1, 1 ) );
  2757.  
  2758. $
  2759.  
  2760. PTSLNLN
  2761.  
  2762.  VectorType PTSLNLN( PointType Line1Orig, VectorType Line1Ray,
  2763.                      PointType Line2Orig, VectorType Line2Ray )
  2764.  
  2765.    Computes the closest two points on the two lines defined by point
  2766.  LineiOrig and ray LineiRay. See also DSTLNLN.  Returned
  2767.  is a list object with the two points.
  2768.  
  2769.  Example:
  2770.  
  2771.  ClosestPts = PtsLnLn( point( 1, 0, 0 ), vector( 0, 1, 0 ),
  2772.                        point( 0, 1, 0 ), vector( 1, 0, 0 ) );
  2773. $
  2774.  
  2775. RULEDSRF
  2776.  
  2777.  SurfaceType RULEDSRF( CurveType Crv1, CurveType Crv2 )
  2778.  
  2779.    Constructs a ruled surface between the two curves Crv1 and Crv2.
  2780.    The curves do not have to have the same order or type, and will be promoted
  2781.  to their least common denominator.
  2782.  
  2783.  Example:
  2784.  
  2785.     c1 = cbspline( 3,
  2786.                  list( ctlpt(E3, 1.7, 0.0 , 0  ),
  2787.                        ctlpt(E3, 0.7, 0.7 , 0  ),
  2788.                        ctlpt(E3, 1.7, 0.3 , 0  ),
  2789.                        ctlpt(E3, 1.5, 0.8 , 0  ),
  2790.                        ctlpt(E3, 1.6, 1.0 , 0  ) ),
  2791.             list( KV_OPEN ) );
  2792.     c2 = cbspline( 3,
  2793.                  list( ctlpt(E3, 0.7, 0.0 , 0  ),
  2794.                        ctlpt(E3,-0.7, 0.2 , 0  ),
  2795.                        ctlpt(E3, 0.7, 0.5 , 0  ),
  2796.                        ctlpt(E3,-0.7, 0.7 , 0  ),
  2797.                        ctlpt(E3, 0.7, 1.0 , 0  ) ) ,
  2798.             list( KV_OPEN ) );
  2799.     
  2800.     srf1 = RULEDSRF( c1, c2 );
  2801.     interact( list( c1, c2, srf1 ), on );
  2802.     
  2803.     c2a = ffmatch( c1, c2, 50, 100, 2, false, 1 );
  2804.     srf2 = RULEDSRF( c1, c2a );
  2805.     interact( list( c1, c2, srf2 ), on );
  2806.  
  2807.  Constructs a planar ruled surface between two curves, c1 and c2.
  2808.  The naive construction causes self intersection, but by employing FFMATCH
  2809.  the self intersection can be resloved.
  2810.  
  2811.  See also FFMATCH.
  2812. $
  2813.  
  2814. SBEZIER
  2815.  
  2816.  SurfaceType SBEZIER( ListType CtlMesh )
  2817.  
  2818.    Creates a Bezier surface using the provided control mesh. CtlMesh is a
  2819.  list of rows, each of which is a list of control points. All control points
  2820.  must be of type (E1-E5, P1-P5), or regular PointType defining the surface's
  2821.  control polygon. Surface's point type will be of a space which is the union
  2822.  of the spaces of all points.
  2823.  
  2824.  Example:
  2825.  
  2826.    Srf = SBEZIER( list ( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  2827.                                ctlpt( E3, 0.0, 1.0, 0.0 ),
  2828.                                ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  2829.                          list( ctlpt( E3, 1.0, 0.0, 0.0 ),
  2830.                                ctlpt( E3, 1.0, 1.0, 2.0 ),
  2831.                                ctlpt( E3, 1.0, 2.0, 0.0 ) ),
  2832.                          list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  2833.                                ctlpt( E3, 2.0, 1.0, 0.0 ),
  2834.                                ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  2835.                          list( ctlpt( E3, 3.0, 0.0, 0.0 ),
  2836.                                ctlpt( E3, 3.0, 1.0, 2.0 ),
  2837.                                ctlpt( E3, 3.0, 2.0, 0.0 ) ),
  2838.                          list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  2839.                                ctlpt( E3, 4.0, 1.0, 0.0 ),
  2840.                                ctlpt( E3, 4.0, 2.0, 1.0 ) ) ) );
  2841. $
  2842.  
  2843. SBSPLINE
  2844.  
  2845.  SurfaceType SBSPLINE( NumericType UOrder, NumericType VOrder,
  2846.                        ListType CtlMesh, ListType KnotVectors )
  2847.  
  2848.    Creates a Bspline surface from the provided UOrder and VOrder
  2849.  orders, the control mesh CtlMesh, and the two knot vectors KnotVectors.
  2850.  CtlMesh is a list of rows, each of which is a list of control points.
  2851.  All control points must be of point type (E1-E5, P1-P5), or regular
  2852.  PointType defining the surface's control mesh. Surface's point type will
  2853.  be of a space which is the union of the spaces of all points.
  2854.    KnotVectors is a list of two knot vectors. Each knot vector is a
  2855.  list of NumericType knots of length #CtlPtList plus the Order.
  2856.  If, however, the length of the knot vector is equal to #CtlPtList +
  2857.  Order + Order - 1} the curve is assumed periodic. 
  2858.    The knot vector may also be a list of a single constant KV_OPEN or
  2859.  KV_FLOAT or KV_PERIODIC, in which a uniform knot vector with the
  2860.  appropriate length and with open, floating or periodic end condition
  2861.  will be constructed automatically.
  2862.  
  2863.  Example:
  2864.  
  2865.     Mesh = list ( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  2866.                         ctlpt( E3, 0.0, 1.0, 0.0 ),
  2867.                         ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  2868.                   list( ctlpt( E3, 1.0, 0.0, 0.0 ),
  2869.                         ctlpt( E3, 1.0, 1.0, 2.0 ),
  2870.                         ctlpt( E3, 1.0, 2.0, 0.0 ) ),
  2871.                   list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  2872.                         ctlpt( E3, 2.0, 1.0, 0.0 ),
  2873.                         ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  2874.                   list( ctlpt( E3, 3.0, 0.0, 0.0 ),
  2875.                         ctlpt( E3, 3.0, 1.0, 2.0 ),
  2876.                         ctlpt( E3, 3.0, 2.0, 0.0 ) ),
  2877.                   list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  2878.                         ctlpt( E3, 4.0, 1.0, 0.0 ),
  2879.                         ctlpt( E3, 4.0, 2.0, 1.0 ) ) );
  2880.     Srf = SBSPLINE( 3, 3, Mesh, list( list( KV_OPEN ),
  2881.                                       list( 3, 3, 3, 4, 5, 6, 6, 6 ) ) );
  2882.  
  2883.  constructs a bi-quadratic Bspline surface with its first knot vector
  2884.  having uniform knot spacing with open end conditions.
  2885. $
  2886.  
  2887. SCRVTR
  2888.  
  2889.  SurfaceType SCRVTR( SurfaceType Srf, ConstType PtType, ConstType Dir )
  2890.  
  2891.    Symbolically computes the extreme curvature bound on Srf.
  2892.    If Dir is either ROW or COL, then the normal curvature square
  2893.  of Srf in Dir is computed symbolically and returned.
  2894.    Otherwise, a upper bound on the sum of the squares of the two
  2895.  principal curvatures is symbolically computed and returned.
  2896.    
  2897.    Returned value is a surface that can be evaluated to the curvature
  2898.  bound, given a UV location. The returned surface value is a scalar field
  2899.  of point type P1 (scalar rational).
  2900.    However, if PtType is one of E1, P1, E3, P3 the returned surface
  2901.  is coerced to this given type. If the types are one of E3, P3, then the
  2902.  Y and Z axes are set to be equivalent to the U and V parametric domains.
  2903.  
  2904.    This function computes the square of the normal curvature scalar
  2905.  field for surfaces as (in the U parametric direction, same for V),
  2906.                      2  
  2907.                     d S
  2908.               < n , --- >
  2909.                       2
  2910.     u               du
  2911.    k (u, v) = ------------
  2912.     n         
  2913.                  dS   ds
  2914.                < -- , -- >
  2915.                  du   du
  2916.  
  2917.  and computes the sum of the squares of the principal curvatures as,
  2918.  
  2919.   2    2  ( g11 l22 + g22 l11 - 2 g12 l12 )^2 - 2 |G| |L|
  2920.  k  + k = -----------------------------------------------
  2921.   1    2                   |G|^2 ||n||^2
  2922.  
  2923.  
  2924.  See also CCRVTR.
  2925.  
  2926.  Example:
  2927.  
  2928.  cross = cbspline( 3,
  2929.                    list( ctlpt( E2,  0.0,  0.0 ),
  2930.                          ctlpt( E2,  0.8,  0.0 ),
  2931.                          ctlpt( E2,  0.8,  0.2 ),
  2932.                          ctlpt( E2,  0.07, 1.4 ),
  2933.                          ctlpt( E2, -0.07, 1.4 ),
  2934.                          ctlpt( E2, -0.8,  0.2 ),
  2935.                          ctlpt( E2, -0.8,  0.0 ),
  2936.                          ctlpt( E2,  0.0,  0.0 ) ),
  2937.                    list( KV_OPEN ) );
  2938.  cross = coerce( cross, e3 );
  2939.  s = sFromCrvs( list( cross,
  2940.                       cross * trans( vector( 0.5, 0, 1 ) ),
  2941.                       cross * trans( vector( 0, 0, 2 ) ) ), 3 );
  2942.  view( list( s, axes ), on );
  2943.  
  2944.  UCrvtrZXY = scrvtr( s, E3, row );
  2945.  VCrvtrZXY = scrvtr( s, E3, col );
  2946.  UCrvtrXYZ = UCrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 0.001 ) );
  2947.  VCrvtrXYZ = VCrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 10 ) );
  2948.  color( UCrvtrXYZ, red );
  2949.  color( VCrvtrXYZ, magenta );
  2950.  
  2951.  view( list( UCrvtrXYZ, VCrvtrXYZ ), off );
  2952.  
  2953.  CrvtrZXY = scrvtr( s, E3, off );
  2954.  CrvtrXYZ = CrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 0.001 ) );
  2955.  color( CrvtrXYZ, green );
  2956.  
  2957.  view( CrvtrXYZ, off );
  2958.  
  2959.  Computes the sqaure of the normal curvature in the U and V direction, flips
  2960.  its scalar value from X to Z using rotations and scale the fields to
  2961.  reasonable values and display them.
  2962.    Then, display a total bound on the normal curvature as well.
  2963.  
  2964.  Due to the large degree of the resulting fields be warned that rational
  2965.  surfaces will compute into large degree curvature bound fields. See also
  2966.  IRITSTATE("InterpProd", FALSE); for faster symbolic computation.
  2967. $
  2968.  
  2969. SDERIVE
  2970.  
  2971.  SurfaceType SDERIVE( SurfaceType Srf, NumericType Dir )
  2972.  
  2973.    Returns a vector field surface representing the differentiated surface
  2974.  in the given direction (ROW or COL). Evaluation of the returned surface at
  2975.  a given parameter value will return a vector tangent to Srf in
  2976.  Dir at that parameter value.
  2977.  
  2978.  DuSrf = SDERIVE( Srf, ROW );
  2979.  DvSrf = SDERIVE( Srf, COL );
  2980.  Normal = coerce( seval( DuSrf, 0.5, 0.5 ), VECTOR_TYPE ) ^
  2981.           coerce( seval( DvSrf, 0.5, 0.5 ), VECTOR_TYPE );
  2982.  
  2983.  computes the two partial derivatives of the surface Srf and computes
  2984.  its normal as their cross product, at the parametric location (0.5, 0.5).
  2985. $
  2986.  
  2987. SDIVIDE
  2988.  
  2989.  SurfaceType SDIVIDE( SurfaceType Srf, ConstantType Direction,
  2990.                                                           NumericType Param )
  2991.  
  2992.  or
  2993.  
  2994.  TrimSrfType SDIVIDE( TrimSrfType Srf, ConstantType Direction,
  2995.                                                           NumericType Param )
  2996.  
  2997.    Subdivides a (possibly trimmed) surface into two at the specified parameter
  2998.  value Param in the specified Direction (ROW or COL). Srf
  2999.  can be either a Bspline surface in which Param must be conatined in
  3000.  the parametric domain of the surface, or a Bezier surface in which  Param} must be in the range of zero to one.
  3001.  
  3002.    It returns a list of upto two sub-surfaces. The individual surfaces may be
  3003.  extracted from the list using the NTH command. If Srf is a trimmed
  3004.  surface, it can be the case that one of the two subdivided surfaces is
  3005.  completely trimmed out, and hence only one surface will be returned.
  3006.  
  3007.  Example:
  3008.  
  3009.     SrfLst = SDIVIDE( Srf, ROW, 0.5 );
  3010.     Srf1 = nth( SrfLst, 1 );
  3011.     Srf2 = nth( SrfLst, 2 );
  3012.  
  3013.  Subdivides Srf at the parameter value of 0.5 in the ROW direction.
  3014. $
  3015.  
  3016. SEDITPT
  3017.  
  3018.  SurfaceType SEDITPT( SurfaceType Srf, CtlPtType CPt, NumericType UIndex,
  3019.                                                       NumericType VIndex )
  3020.  
  3021.    Provides a simple mechanism to manually modify a single control point number
  3022.  UIndex and VIndex (base count is 0) in the control mesh of Srf
  3023.  by substituting CtlPt instead. CtlPt must have the same point type as
  3024.  the control points of Srf. Original surface Srf is not modified.
  3025.  
  3026.  Example:
  3027.  
  3028.     CPt = ctlpt( E3, 1, 2, 3 );
  3029.     NewSrf = SEDITPT( Srf, CPt, 0, 0 );
  3030.  
  3031.  Constructs a NewSrf with the first control point of Srf being
  3032.  CPt.
  3033. $
  3034.  
  3035. SEVAL
  3036.  
  3037.  CtlPtType SEVAL( SurfaceType Srf, NumericType UParam, NumericType VParam )
  3038.  
  3039.  or
  3040.  
  3041.  CtlPtType SEVAL( TrimSrfType Srf, NumericType UParam, NumericType VParam )
  3042.  
  3043.    Evaluates the provided (possibly trimmed) surface Srf at the given
  3044.  UParam and VParam parameters. Both UParam and VParam
  3045.  should be contained in the surface parametric domain if Srf is a
  3046.  Bspline surface, or between zero and one if Srf is a Bezier surface.
  3047.  The returned control point has the same type as the control points of
  3048.  Srf.
  3049.  
  3050.  Example:
  3051.  
  3052.     CPt = SEVAL( Srf, 0.25, 0.22 );
  3053.  
  3054.  Evaluates Srf at the parameter values of (0.25, 0.22).
  3055. $
  3056.  
  3057. SFOCAL
  3058.  
  3059.  SurfaceType SFOCAL( SurfaceType Srf, NumericType Dir )
  3060.  
  3061.    Evaluates the focal surface field of surface Srf using the normal
  3062.  curvature in the isoparametric direction as given by Dir (either
  3063.  ROW or COL). Note this function is not using the principal curvatures as
  3064.  is generaly the case for focal surfaces.
  3065.  
  3066.  Example:
  3067.  
  3068.     gcross = cbspline( 3,
  3069.                        list( ctlpt( E3, 0.3, 0.0, 0.0 ),
  3070.                              ctlpt( E3, 0.1, 0.0, 0.1 ),
  3071.                              ctlpt( E3, 0.1, 0.0, 0.4 ),
  3072.                              ctlpt( E3, 0.5, 0.0, 0.5 ),
  3073.                              ctlpt( E3, 0.6, 0.0, 0.8 ) ),
  3074.                        list( KV_OPEN ) );
  3075.     glass = surfprev( gcross );
  3076.     color( glass, red );
  3077.     
  3078.     gfocal = SFOCAL(glass, col);
  3079.  
  3080.  Evaluates the focal surface using the COL isoparametric direction's
  3081.  normal curvature of the glass surface.
  3082. $
  3083.  
  3084. SFROMCRVS
  3085.  
  3086.  SurfaceType SFROMCRVS( ListType CrvList, NumericType OtherOrder )
  3087.  
  3088.    Constructs a surface by substituting the curves in CrvList as rows
  3089.  in a control mesh of a surface. Curves in CrvList are made compatible
  3090.  by promoting Bezier curves to Bsplines if necessary, and raising degree
  3091.  and refining as required before substituting the control polygons of the
  3092.  curves as rows in the mesh. The other direction order is set by
  3093.  OtherOrder, which cannot be larger than the number of curves.
  3094.  
  3095.    The surface interpolates the first and last curves only.
  3096.  
  3097.  Example:
  3098.  
  3099.     Crv1 = cbspline( 3,
  3100.                      list( ctlpt( E3, 0.0, 0.0, 0.0 ),
  3101.                            ctlpt( E3, 1.0, 0.0, 0.0 ),
  3102.                            ctlpt( E3, 1.0, 1.0, 0.0 ) ),
  3103.                      list( KV_OPEN ) );
  3104.     Crv2 = Crv1 * trans( vector( 0.0, 0.0, 1.0 ) );
  3105.     Crv3 = Crv2 * trans( vector( 0.0, 1.0, 0.0 ) );
  3106.     Srf = SFROMCRVS( list( Crv1, Crv2, Crv3 ), 3 );
  3107. $
  3108.  
  3109. SGAUSS
  3110.  
  3111.  SurfaceType SGAUSS( SurfaceType Srf )
  3112.  
  3113.    Evaluates the Gaussian curvature field of surface Srf.
  3114.  
  3115.  Example:
  3116.  
  3117.     Srf1 = hermite( cbezier( list( ctlpt( E3, 0.0, 0.0, 0.0 ),
  3118.                                    ctlpt( E3, 0.5, 0.2, 0.0 ),
  3119.                                    ctlpt( E3, 1.0, 0.0, 0.0 ) ) ),
  3120.                     cbezier( list( ctlpt( E3, 0.0, 1.0, 0.0 ),
  3121.                                    ctlpt( E3, 0.5, 0.8, 0.0 ),
  3122.                                    ctlpt( E3, 1.0, 1.0, 0.5 ) ) ),
  3123.                     cbezier( list( ctlpt( E3, 0.0, 2.0, 0.0 ),
  3124.                                    ctlpt( E3, 0.0, 2.0, 0.0 ),
  3125.                                    ctlpt( E3, 0.0, 2.0, 0.0 ) ) ),
  3126.                     cbezier( list( ctlpt( E3, 0.0, 2.0, 0.0 ),
  3127.                                    ctlpt( E3, 0.0, 2.0, 0.0 ),
  3128.                                    ctlpt( E3, 0.0, 2.0, 0.0 ) ) ) );
  3129.  
  3130.     SGauss = SGAUSS( Srf1 );
  3131.  
  3132.  Evaluates the Gaussian curvaure of Srf1.
  3133. $
  3134.  
  3135. SINTERP
  3136.  
  3137.  SurfaceType SINTERP( ListType PtList, NumericType UOrder, NumericType VOrder,
  3138.                       NumericType USize, NumericType VSize,
  3139.                       ConstantType Param)
  3140.  
  3141.    Computes a Bspline polynomial surface that interpolates or approximates
  3142.  the rectangular grid of points in PtList. The Bspline surface will
  3143.  have orders UOrder and VOrder and mesh of size USize by
  3144.  VSize control points. The knots will be spaced according to
  3145.  Param which can be one of PARAM_UNIFORM, PARAM_CHORD or
  3146.  PARAM_CENTRIP. The former prescribed a uniform knot sequence and the
  3147.  latters specified a knot spacing accoridng to the chord length and a square
  3148.  root of the chord length. Currently only PARAM_UNIFORM is supported.
  3149.    PtList is a list of list of points where all lists should carry the
  3150.  same amount of points in them, defining a rectangular grid. All points in
  3151.  PtList must be of type (E1-E5, P1-P5) control point, or regular
  3152.  PointType. If USize and VSize are equal to the number of points
  3153.  in the grid PtList the resulting curve will interpolate the
  3154.  data set. Otherwise, if USize or VSize is less than the number
  3155.  of points in PtList the point data set will be least square
  3156.  approximated. In no time can USize or VSize be larger that the
  3157.  number of points in PtList or lower than UOrder and VOrder,
  3158.  respectively. If USize or VSize are zero, the grid size
  3159.  is used, forcing an interpolation of the data set.
  3160.  
  3161.    All interior knots will be distinct preserving maximal continuity.
  3162.  The resulting Bspline surface will have open end conditions.
  3163.  
  3164.  Example:
  3165.  
  3166.     pl = nil();
  3167.     pll = nil();
  3168.     for ( x = -5, 1, 5,
  3169.           pl = nil():
  3170.           for ( y = -5, 1, 5,
  3171.                 snoc( point( x, y, sin( x * Pi / 2 ) * cos( y * Pi / 2 ) ),
  3172.                       pl )
  3173.           ):
  3174.           snoc( pl, pll ) );
  3175.  
  3176.     s1 = sinterp( pll, 3, 3, 8, 8, PARAM_UNIFORM );
  3177.     s2 = sinterp( pll, 3, 3, 11, 11, PARAM_UNIFORM );
  3178.  
  3179.  Samples an explicit surface sin(x) * cos(y) at a grid of 11 by 11 points,
  3180.  least square fit with a grid of size of 8 by 8 surface s1, and
  3181.  interpolate surface s2 using this data set.
  3182. $
  3183.  
  3184. SMEANSQR
  3185.  
  3186.  SurfaceType SMEANSQR( SurfaceType Srf )
  3187.  
  3188.    Evaluates the square of the mean curvature field of surface Srf.
  3189.  
  3190.  Example:
  3191.  
  3192.     Srf1 = hermite( cbezier( list( ctlpt( E3, 0.0, 0.0, 0.0 ),
  3193.                                    ctlpt( E3, 0.5, 0.2, 0.0 ),
  3194.                                    ctlpt( E3, 1.0, 0.0, 0.0 ) ) ),
  3195.                     cbezier( list( ctlpt( E3, 0.0, 1.0, 0.0 ),
  3196.                                    ctlpt( E3, 0.5, 0.8, 0.0 ),
  3197.                                    ctlpt( E3, 1.0, 1.0, 0.5 ) ) ),
  3198.                     cbezier( list( ctlpt( E3, 0.0, 2.0, 0.0 ),
  3199.                                    ctlpt( E3, 0.0, 2.0, 0.0 ),
  3200.                                    ctlpt( E3, 0.0, 2.0, 0.0 ) ) ),
  3201.                     cbezier( list( ctlpt( E3, 0.0, 2.0, 0.0 ),
  3202.                                    ctlpt( E3, 0.0, 2.0, 0.0 ),
  3203.                                    ctlpt( E3, 0.0, 2.0, 0.0 ) ) ) );
  3204.  
  3205.     SMean = SMEANSQR( Srf1 );
  3206.  
  3207.  Evaluates the square of the mean curvaure of Srf1.
  3208. $
  3209.  
  3210. SMERGE
  3211.  
  3212.  SurfaceType SMERGE( SurfaceType Srf1, SurfaceType Srf2,
  3213.                      NumericType Dir, NumericType SameEdge )
  3214.  
  3215.  Merges two surfaces along the requested direction (ROW or COL). If
  3216.  SameEdge is non-zero (ON or TRUE), then the common edge is assumed to be
  3217.  identical and copied only once. Otherwise (OFF or FALSE), a ruled surface
  3218.  is constructed between the two surfaces along the (not) common edge.
  3219.  
  3220.  Example:
  3221.  
  3222.  MergedSrf = SMERGE( Srf1, Srf2, ROW, TRUE );
  3223. $
  3224.  
  3225. SMORPH
  3226.  
  3227.  SurfaceType SMORPH( SurfaceType Srf1, SurfaceType Srf2, NumericType Blend )
  3228.  
  3229.  Creates a new surface which is a convex blend of the two given surfaces.
  3230.  The two given surfaces must be compatible (see FFCOMPAT) before this blend
  3231.  is invoked. Very useful if a sequence that "morphs" one surface to another
  3232.  is to be created.
  3233.  
  3234.  Example:
  3235.  
  3236.  for ( i = 0.0, 1.0, 11.0,
  3237.         Msrf = SMORPH( Srf1, Srf2, i / 11.0 ):
  3238.         color( Msrf, white ):
  3239.         attrib( Msrf, "rgb", "255,255,255" ):
  3240.         attrib( Msrf, "reflect", "0.7" ):
  3241.         save( "morp1-" + i, Msrf )
  3242.  );
  3243.  
  3244.  creates a sequence of 12 surfaces, morphed from Srf1 to Srf2
  3245.  and saves them in the files "morph-0.dat" to "morph-11.dat".
  3246.  See also CMORPH.
  3247. $
  3248.  
  3249. SNORMAL
  3250.  
  3251.  VectorType SNORMAL( SurfaceType Srf, NumericType UParam, NumericType VParam )
  3252.  
  3253.  or
  3254.  
  3255.  VectorType SNORMAL( TrimSrfType Srf, NumericType UParam, NumericType VParam )
  3256.  
  3257.    Computes the normal vector to (possibly trimmed) surface Srf at the
  3258.  parameter values UParam and VParam. The returned vector has a
  3259.  unit length.
  3260.  
  3261.  Example:
  3262.  
  3263.     Normal = SNORMAL( Srf, 0.5, 0.5 );
  3264.  
  3265.  computes the normal to Srf at the parameter values (0.5, 0.5).
  3266.  See also SNRMLSRF.
  3267. $
  3268.  
  3269. SNRMLSRF
  3270.  
  3271.  SurfaceType SNRMLSRF( SurfaceType Srf )
  3272.  
  3273.  Symbolically computes a vector field surface representing the non-normalized
  3274.  normals of the given surface. That is the normal surface, evaluated at
  3275.  (u, v), provides a vector in the direction of the normal of the original
  3276.  surface at (u, v). The normal surface is computed as the symbolic cross
  3277.  product of the two surfaces representing the partial derivatives of the
  3278.  original surface.
  3279.  
  3280.  Example:
  3281.  
  3282.  NrmlSrf = SNRMLSRF( Srf );
  3283. $
  3284.  
  3285. SPHERE
  3286.  
  3287.  PolygonType SPHERE( VectorType Center, NumericType Radius )
  3288.  
  3289.    Creates a SPHERE geometric object, defined by Center as the center of
  3290.  the SPHERE, and with Radius as the radius of the SPHERE.
  3291.    See RESOLUTION for accuracy of SPHERE approximation as a polygonal model. 
  3292. $
  3293.  
  3294. SRAISE
  3295.  
  3296.  SurfaceType SRAISE( SurfaceType Srf, ConstantType Direction,
  3297.                                                       NumericType NewOrder )
  3298.  
  3299.    Raises Srf to the specified NewOrder in the specified
  3300.  Direction.
  3301.  
  3302.  Example:
  3303.  
  3304.     Srf = ruledSrf( cbezier( list( ctlpt( E3, -0.5, -0.5, 0.0 ),
  3305.                                    ctlpt( E3,  0.5, -0.5, 0.0 ) ) ),
  3306.                     cbezier( list( ctlpt( E3, -0.5,  0.5, 0.0 ),
  3307.                                    ctlpt( E3,  0.5,  0.5, 0.0 ) ) ) );
  3308.     Srf = SRAISE( SRAISE( Srf, ROW, 3 ), COL, 3 );
  3309.  
  3310.  constructs a bilinear flat ruled surface and raises both its directions to be
  3311.  a bi-quadratic surface.
  3312. $
  3313.  
  3314. SREFINE
  3315.  
  3316.  SurfaceType SREFINE( SurfaceType Srf, ConstantType Direction,
  3317.                       NumericType Replace, ListType KnotList )
  3318.  
  3319.    Provides the ability to Replace a knot vector of Srf or refine 
  3320.  it in the specified direction Direction (ROW or COL).
  3321.    KnotList is a list of knots to refine Srf at. All knots should be
  3322.  contained in the parametric domain of Srf in Direction. If the knot
  3323.  vector is replaced, the length of KnotList should be identical to the
  3324.  length of the original knot vector of Srf in Direction. If Srf
  3325.  is a Bezier surface, it is automatically promoted to be a Bspline surface.
  3326.  
  3327.  Example:
  3328.  
  3329.     Srf = SREFINE( SREFINE( Srf,
  3330.                             ROW, FALSE, list( 0.333, 0.667 ) ),
  3331.                    COL, FALSE, list( 0.333, 0.667 ) );
  3332.  
  3333.  refines Srf in both directions by adding two more knots at 0.333 and
  3334.  0.667.
  3335. $
  3336.  
  3337. SREGION
  3338.  
  3339.  SurfaceType SREGION( SurfaceType Srf, ConstantType Direction,
  3340.                                   NumericType MinParam, NumericType MaxParam )
  3341.  
  3342.    Extracts a region of Srf between MinParam and MaxParam
  3343.  in the specified Direction. Both MinParam and MaxParam
  3344.  should be contained in the parametric domain of Srf in Direction.
  3345.  
  3346.  Example:
  3347.  
  3348.     Srf = ruledSrf( cbezier( list( ctlpt( E3, -0.5, -0.5, 0.5 ),
  3349.                                    ctlpt( E3,  0.0,  0.5, 0.0 ),
  3350.                                    ctlpt( E3,  0.5, -0.5, 0.0 ) ) ),
  3351.                     cbezier( list( ctlpt( E3, -0.5,  0.5, 0.0 ),
  3352.                                    ctlpt( E3,  0.0,  0.0, 0.0 ),
  3353.                                    ctlpt( E3,  0.5,  0.5, 0.5 ) ) ) );
  3354.     SubSrf = SREGION( Srf, ROW, 0.3, 0.6 );
  3355.  
  3356.  extracts the region of Srf from the parameter value 0.3 to the
  3357.  parameter value 0.6 along the ROW direction. the COLumn direction is
  3358.  extracted as a whole.
  3359. $
  3360.  
  3361. SREPARAM
  3362.  
  3363.  SurfaceType SREPARAM( SurfaceType Srf, ConstantType Direction,
  3364.                                   NumericType MinParam, NumericType MaxParam )
  3365.  
  3366.    Reparametrize Srf over a new domain from MinParam to MaxParam,
  3367.  in the prescribed Direction. This operation does not affect the geometry
  3368.  of the surface and only affine transforms its knot vectors. A Bezier surface
  3369.  will automatically be promoted into a Bspline surface by this function.
  3370.  
  3371.  Example:
  3372.  
  3373.     srf = sbspline( 2, 4,
  3374.                      list( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  3375.                                  ctlpt( E2, 0.0, 1.0 ),
  3376.                                  ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  3377.                            list( ctlpt( E2, 1.0, 0.0 ),
  3378.                                  ctlpt( E3, 1.0, 1.0, 2.0 ),
  3379.                                  ctlpt( E2, 1.0, 2.0 ) ),
  3380.                            list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  3381.                                  ctlpt( E2, 2.0, 1.0 ),
  3382.                                  ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  3383.                            list( ctlpt( E2, 3.0, 0.0 ),
  3384.                                  ctlpt( E3, 3.0, 1.0, 2.0 ),
  3385.                                  ctlpt( E2, 3.0, 2.0 ) ),
  3386.                            list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  3387.                                  ctlpt( E2, 4.0, 1.0 ),
  3388.                                  ctlpt( E3, 4.0, 2.0, 1.0 ) ) ),
  3389.                      list( list( KV_OPEN ),
  3390.                            list( KV_OPEN ) ) );
  3391.     
  3392.     srf = sreparam( sreparam( srf, ROW, 0, 1 ), COL, 0, 1 );
  3393.  
  3394.  Ensures that the Bspline surface is defined over the unit size parametric
  3395.  domain.
  3396. $
  3397.  
  3398. SRINTER
  3399.  
  3400.  PointType SRINTER( SurfaceType Srf, PointType RayOrigin,
  3401.                     VectorType RayDirection )
  3402.  
  3403.    Computes the first intersection, if any, of the prescribed ray originating
  3404.  from RayOrigin in direction RayDirection with surface Srf.
  3405.    Returns the intersection point in the parametric space of Srf with
  3406.  the U and V coordinates as the X and Y coefficients of the returned value.
  3407.    The intersection is computed between the ray and a polygonal approximation
  3408.  of the surface Srf as set via the RESOLUTION variable.
  3409.  
  3410.  Example:
  3411.  
  3412.     RayOrigin = point( 2, 0.1, 0.3 );
  3413.     RayDir = vector( -4, 0, 0 );
  3414.  
  3415.     RayLine = coerce( RayOrigin, E3 ) + coerce( RayOrigin + RayDir, E3 );
  3416.     color( RayLine, magenta );
  3417.     attrib( RayLine, "dwidth", 2 );
  3418.  
  3419.     resolution = 5;
  3420.     InterPt = SRINTER( glass, RayOrigin, RayDir );
  3421.     InterPtE3 = seval( glass, coord( InterPt, 0 ), coord( InterPt, 1 ) );
  3422.     color( InterPtE3, cyan );
  3423.     attrib( InterPtE3, "dwidth", 3 );
  3424.     view( list( InterPtE3, RayLine, glass, axes ), 1 );
  3425.  
  3426.     resolution = 80;
  3427.     InterPt = SRINTER( glass, RayOrigin, RayDir );
  3428.     InterPtE3 = seval( glass, coord( InterPt, 0 ), coord( InterPt, 1 ) );
  3429.     color( InterPtE3, cyan );
  3430.     attrib( InterPtE3, "dwidth", 3 );
  3431.     view( list( InterPtE3, RayLine, glass, axes ), 1 );
  3432.  
  3433.  A complete example of constructing a ray and intersecting it against a
  3434.  surface of a glass at two different resolution, resulting in two different
  3435.  accuracies. See also RESOLUTION.
  3436. $
  3437.  
  3438. STANGENT
  3439.  
  3440.  VectorType STANGENT( SurfaceType Srf, ConstantType Direction,
  3441.                       NumericType UParam, NumericType VParam )
  3442.  
  3443.  or
  3444.  
  3445.  VectorType STANGENT( TrimSrfType Srf, ConstantType Direction,
  3446.                       NumericType UParam, NumericType VParam )
  3447.  
  3448.    Computes the tangent vector to (possibly trimmed) surface Srf at the
  3449.  parameter values UParam and VParam in Direction. The
  3450.  returned vector has a unit length.
  3451.  
  3452.  Example:
  3453.  
  3454.     Tang = STANGENT( Srf, ROW, 0.5, 0.6 );
  3455.  
  3456.  computes the tangent to Srf in the ROW direction at the parameter
  3457.  values (0.5, 0.6).
  3458. $
  3459.  
  3460. STRIMSRF
  3461.  
  3462.  SurfaceType STRIMSRF( TrimSrfType TSrf )
  3463.  
  3464.    Extracts the surface of a trimmed surface TSrf.
  3465.  
  3466.  Example:
  3467.  
  3468.     Srf = STRIMSRF( TrimSrf ); 
  3469.  
  3470.  extracts the surface of TrimSrf.
  3471. $
  3472.  
  3473. STRIVAR
  3474.  
  3475.  SurfaceType STRIVAR( TrivarType TV )
  3476.  
  3477.    Extracts an iso surface from a trivariate function TV.
  3478.  
  3479.  Example:
  3480.  
  3481.     TV1 = tbezier( list( list( list( ctlpt( E3, 0.1, 0.0, 0.8 ),
  3482.                                      ctlpt( E3, 0.2, 0.1, 2.4 ) ),
  3483.                                list( ctlpt( E3, 0.3, 2.2, 0.2 ),
  3484.                                      ctlpt( E3, 0.4, 2.3, 2.0 ) ) ),
  3485.                          list( list( ctlpt( E3, 2.4, 0.8, 0.1 ),
  3486.                                      ctlpt( E3, 2.2, 0.7, 2.3 ) ),
  3487.                                list( ctlpt( E3, 2.3, 2.6, 0.5 ),
  3488.                                      ctlpt( E3, 2.1, 2.5, 2.7) ) ) ) );
  3489.     Srf = STRIVAR( TV1, col, 0.4 ); 
  3490.  
  3491.  extracts an iso surface of TV1, in the col direction at
  3492.  parameter value 0.4.
  3493. $
  3494.  
  3495. SURFPREV
  3496.  
  3497.  SurfaceType SURFPREV( CurveType Object )
  3498.  
  3499.  Same as SURFREV but approximates the surface of revolution as a
  3500.  polynomial surface. Object must be a polynomial curve.
  3501.  See SURFREV.
  3502. $
  3503.  
  3504. SURFREV
  3505.  
  3506.  PolygonType SURFREV( PolygonType Object )
  3507.  
  3508.  or
  3509.  
  3510.  SurfaceType SURFREV( CurveType Object )
  3511.  
  3512.    Creates a surface of revolution by rotating the first polygon/curve of the
  3513.  given Object, around the Z axis. Use the linear transformation function
  3514.  to position a surface of revolution in a different orientation.
  3515.  
  3516.  Example:
  3517.  
  3518.     VTailAntn = SURFREV( ctlpt( E3, 0.001, 0.0, 1.0 ) +
  3519.                          ctlpt( E3, 0.01,  0.0, 1.0 ) +
  3520.                          ctlpt( E3, 0.01,  0.0, 0.8 ) +
  3521.                          ctlpt( E3, 0.03,  0.0, 0.7 ) +
  3522.                          ctlpt( E3, 0.03,  0.0, 0.3 ) +
  3523.                          ctlpt( E3, 0.001, 0.0, 0.0 ) );
  3524.  
  3525.  constructs a piecewise linear Bspline curve in the XZ plane and uses it to
  3526.  construct a surface of revolution by rotating it around the Z axis.
  3527.    See also SURFPREV.
  3528. $
  3529.  
  3530. SWEEPSRF
  3531.  
  3532.  SurfaceType SWEEPSRF( CurveType CrossSection, CurveType Axis,
  3533.                      CurveType FrameCrv | VectorType FrameVec | ConstType OFF )
  3534.  
  3535.    Constructs a generalized cylinder surface. This function sweeps a specified
  3536.  cross-section CrossSection along the provided Axis.
  3537.    By default, when frame specification is OFF, the orientation
  3538.  of the cross section is computed using the Axis curve tangent and
  3539.  normal. However, unlike the Frenet frame, attempt is made to minimize
  3540.  the normal change, as can happen along inflection points in Axis.
  3541.    If a VectorType FrameVec is provided as a frame orientation setting,
  3542.  it is used to fix the binormal direction to this value. In other words, the
  3543.  orientation frame has a fixed binormal. If a CurveType FrameCrv is
  3544.  specified as a frame orientation setting, this vector field curve is
  3545.  evaluated at each placement of the cross-section to yield the needed binormal.
  3546.  
  3547.    The resulting sweep is only an approximation of the real sweep. The
  3548.  resulting sweep surface will not be exact, in general.
  3549.    Refinement of the axis curve at the proper location, where accuracy is
  3550.  important, should improve the accuracy of the output. The parametric domains
  3551.  of FrameCrv do not have to match the parametric domain of Axis,
  3552.  and its parametric domain is automatically made compatible by this function.
  3553.  
  3554.  Example:
  3555.  
  3556.     Cross = arc( vector( 0.2, 0.0, 0.0 ),
  3557.                  vector( 0.2, 0.2, 0.0 ),
  3558.                  vector( 0.0, 0.2, 0.0 ) ) +
  3559.             arc( vector( 0.0, 0.4, 0.0 ),
  3560.                  vector( 0.1, 0.4, 0.0 ),
  3561.                  vector( 0.1, 0.5, 0.0 ) ) +
  3562.             arc( vector( 0.8, 0.5, 0.0 ),
  3563.                  vector( 0.8, 0.3, 0.0 ),
  3564.                  vector( 1.0, 0.3, 0.0 ) ) +
  3565.             arc( vector( 1.0, 0.1, 0.0 ),
  3566.                  vector( 0.9, 0.1, 0.0 ),
  3567.                  vector( 0.9, 0.0, 0.0 ) ) +
  3568.             ctlpt( E2, 0.2, 0.0 );
  3569.     Axis = arc( vector( -1.0, 0.0, 0.0 ),
  3570.                 vector(  0.0, 0.0, 0.1 ),
  3571.                 vector(  1.0, 0.0, 0.0 ) );
  3572.     Axis = crefine( Axis, FALSE, list( 0.25, 0.5, 0.75 ) );
  3573.     Srf1 = SWEEPSRF( Cross, Axis, OFF );
  3574.     Srf2 = SWEEPSRF( Cross, Axis, vector( 0.0, 1.0, 1.0 ) );
  3575.     Srf3 = SWEEPSRF( Cross, Axis,
  3576.                      cbezier( list( ctlpt( E3,  1.0, 0.0, 0.0 ),
  3577.                                     ctlpt( E3,  0.0, 1.0, 0.0 ),
  3578.                                     ctlpt( E3, -1.0, 0.0, 0.0 ) ) ) );
  3579.  
  3580.  constructs a rounded rectangle cross-section and sweeps it along an arc,
  3581.  while orienting it several ways. The axis curve Axis is manually
  3582.  refined to better approximate the requested shape.
  3583.  
  3584.  See also SWPSCLSRF for sweep with scale.
  3585. $
  3586.  
  3587. SWPSCLSRF
  3588.  
  3589.  SurfaceType SWPSCLSRF( CurveType CrossSection, CurveType Axis,
  3590.                         NumericType Scale | CurveType ScaleCrv,
  3591.                         CurveType FrameCrv | VectorType FrameVec
  3592.                                                           | ConstType OFF,
  3593.                         NumericType ScaleRefine )
  3594.  
  3595.    Constructs a generalized cylinder surface. This function sweeps a specified
  3596.  cross-section CrossSection along the provided Axis.
  3597.  The cross-section may be scaled by a constant value Scale, or scaled
  3598.  along the Axis parametric direction via a scaling curve ScaleCrv.
  3599.    By default, when frame specification is OFF, the orientation
  3600.  of the cross section is computed using the Axis curve tangent and
  3601.  normal. However, unlike the Frenet frame, attempt is made to minimize
  3602.  the normal change, as can happen along inflection points in Axis.
  3603.    If a VectorType FrameVec is provided as a frame orientation setting,
  3604.  it is used to fix the binormal direction to this value. In other words, the
  3605.  orientation frame has a fixed binormal. If a CurveType FrameCrv is
  3606.  specified as a frame orientation setting, this vector field curve is
  3607.  evaluated at each placement of the cross-section to yield the needed binormal.
  3608.    ScaleRefine is an integer value to define possible refinement of the
  3609.  Axis to reflect the information in ScalingCrv. Value of zero will
  3610.  force no refinement while value of n > 0 will insert n times the
  3611.  number of control points in ScaleCrv into Axis, better emulating
  3612.  the scaling requested.
  3613.    The resulting sweep is only an approximation of the real sweep. The
  3614.  scaling and axis placement will not be exact, in general.
  3615.    Manual refinement (in addition to ScaleRefine) of the axis curve at
  3616.  the proper location, where accuracy is important, should improve the accuracy
  3617.  of the output. The parametric domains of ScaleCrv and FrameCrv do
  3618.  not have to match the parametric domain of Axis, and their domains are
  3619.  made compatible by this function.
  3620.  
  3621.  Example:
  3622.  
  3623.     Cross = arc( vector( -0.11, -0.1,  0.0 ),
  3624.                  vector( -0.1,  -0.1,  0.0 ),
  3625.                  vector( -0.1,  -0.11, 0.0 ) ) +
  3626.             arc( vector(  0.1,  -0.11, 0.0 ),
  3627.                  vector(  0.1,  -0.1,  0.0 ),
  3628.                  vector(  0.11, -0.1,  0.0 ) ) +
  3629.             arc( vector(  0.11,  0.1,  0.0 ),
  3630.                  vector(  0.1,   0.1,  0.0 ),
  3631.                  vector(  0.1,   0.11, 0.0 ) ) +
  3632.             arc( vector( -0.1,   0.11, 0.0 ),
  3633.                  vector( -0.1,   0.1,  0.0 ),
  3634.                  vector( -0.11,  0.1,  0.0 ) ) +
  3635.             ctlpt( E2, -0.11, -0.1 );
  3636.     scaleCrv = cbspline( 3,
  3637.                          list( ctlpt( E2, 0.05, 1.0 ),
  3638.                                ctlpt( E2, 0.1,  0.0 ),
  3639.                                ctlpt( E2, 0.2,  2.0 ),
  3640.                                ctlpt( E2, 0.3,  0.0 ),
  3641.                                ctlpt( E2, 0.4,  2.0 ),
  3642.                                ctlpt( E2, 0.5,  0.0 ),
  3643.                                ctlpt( E2, 0.6,  2.0 ),
  3644.                                ctlpt( E2, 0.7,  0.0 ),
  3645.                                ctlpt( E2, 0.8,  2.0 ),
  3646.                                ctlpt( E2, 0.85, 1.0 ) ),
  3647.                          list( KV_OPEN ) );
  3648.     Axis = circle( vector( 0, 0, 0 ), 1 );
  3649.     Frame = circle( vector( 0, 0, 0 ), 1 )
  3650.             * rotx( 90 ) * trans( vector( 1.5, 0.0, 0.0 ) );
  3651.  
  3652.     Srf1 = SWPSCLSRF( Cross, Axis, scaleCrv, off, 0 );
  3653.     Srf2 = SWPSCLSRF( Cross, Axis, scaleCrv, off, 2 );
  3654.     Srf3 = SWPSCLSRF( Cross, Axis, 1.0, Frame, 0 );
  3655.  
  3656.  constructs a rounded rectangle cross-section and sweeps it along a circle,
  3657.  while scaling and orienting in several ways. The axis curve Axis is
  3658.  automatically refined in Srf2 to better approximate the requested
  3659.  scaling.
  3660.  
  3661.  See also SWEEPSRF for sweep with no scale.
  3662. $
  3663.  
  3664. SYMBPROD
  3665.  
  3666.  CurveType SYMBPROD( CurveType Crv1, CurveType Crv2 )
  3667.  
  3668.  or
  3669.  
  3670.  SurfaceType SYMBPROD( SurfaceType Srf1, SurfaceType Srf2 )
  3671.  
  3672.  Computes the symbolic product of the given two curves or surfaces as
  3673.  a curve or surface. The product is computed coordinate-wise.
  3674.  
  3675.  Example:
  3676.  
  3677.  ProdSrf = SYMBPROD( Srf1, Srf2 )
  3678. $
  3679.  
  3680. SYMBDPROD
  3681.  
  3682.  CurveType SYMBDPROD( CurveType Crv1, CurveType Crv2 )
  3683.  
  3684.  or
  3685.  
  3686.  SurfaceType SYMBDPROD( SurfaceType Srf1, SurfaceType Srf2 )
  3687.  
  3688.  Computes the symbolic dot (inner) product of the given two curves or surfaces
  3689.  as a scalar curve or surface.
  3690.  
  3691.  Example:
  3692.  
  3693.  DiffCrv = symbdiff( Crv1, Crv2 )
  3694.  DistSqrCrv = SYMBDPROD( DiffCrv, DiffCrv )
  3695.  
  3696.  Computes a scalar curve that at parameter t is equal to the distance
  3697.  square between Crv1 at t and Crv2.
  3698. $
  3699.  
  3700. SYMBCPROD
  3701.  
  3702.  CurveType SYMBCPROD( CurveType Crv1, CurveType Crv2 )
  3703.  
  3704.  or
  3705.  
  3706.  SurfaceType SYMBCPROD( SurfaceType Srf1, SurfaceType Srf2 )
  3707.  
  3708.  Computes the symbolic cross product of the given two curves or surfaces as
  3709.  a curve or surface.
  3710.  
  3711.  Example:
  3712.  
  3713.  NrmlSrf = SYMBCPROD( sderive( Srf, ROW ), sderive( Srf, COL ) )
  3714.  
  3715.  computes a normal surface as the cross product of the surface two partial
  3716.  derivatives (see SNRMLSRF).
  3717. $
  3718.  
  3719. SYMBSUM
  3720.  
  3721.  CurveType SYMBSUM( CurveType Crv1, CurveType Crv2 )
  3722.  
  3723.  or
  3724.  
  3725.  SurfaceType SYMBSUM( SurfaceType Srf1, SurfaceType Srf2 )
  3726.  
  3727.  Computes the symbolic sum of the given two curves or surfaces as
  3728.  a curve or surface. The sum is computed coordinate-wise.
  3729.  
  3730.  Example:
  3731.  
  3732.  SumCrv = SYMBSUM( Crv1, Crv2 )
  3733. $
  3734.  
  3735. SYMBDIFF
  3736.  
  3737.  CurveType SYMBDIFF( CurveType Crv1, CurveType Crv2 )
  3738.  
  3739.  or
  3740.  
  3741.  SurfaceType SYMBDIFF( SurfaceType Srf1, SurfaceType Srf2 )
  3742.  
  3743.  Computes the symbolic difference of the given two curves or surfaces as
  3744.  a curve or surface. The difference is computed coordinate-wise.
  3745.  
  3746.  Example:
  3747.  
  3748.  DiffCrv = SYMBDIFF( Crv1, Crv2 )
  3749.  DistSqrCrv = symbdprod( DiffCrv, DiffCrv )
  3750. $
  3751.  
  3752. TBEZIER
  3753.  
  3754.  TrivarType TBEZIER( ListType CtlMesh )
  3755.  
  3756.    Creates a Bezier trivariate using the provided control mesh. CtlMesh
  3757.  is a list of planes, each of which is a list of rows, each of which is a list
  3758.  of control points. All control points must be of type (E1-E5, P1-P5), or
  3759.  regular PointType defining the trivariate's control mesh. Surface's point
  3760.  type will be of a space which is the union of the spaces of all points.
  3761.  
  3762.  Example:
  3763.  
  3764.    TV = TBEZIER( list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
  3765.                                    ctlpt( E3, 0.2, 0.5, 1.1 ),
  3766.                                    ctlpt( E3, 0.3, 0.1, 2.2 ) ),
  3767.                              list( ctlpt( E3, 0.4, 1.3, 0.5 ),
  3768.                                    ctlpt( E3, 0.5, 1.7, 1.7 ),
  3769.                                    ctlpt( E3, 0.6, 1.3, 2.9 ) ),
  3770.                              list( ctlpt( E3, 0.7, 2.4, 0.5 ),
  3771.                                    ctlpt( E3, 0.8, 2.6, 1.4 ),
  3772.                                    ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
  3773.                        list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
  3774.                                    ctlpt( E3, 1.3, 0.2, 1.7 ),
  3775.                                    ctlpt( E3, 1.5, 0.3, 2.9 ) ),
  3776.                              list( ctlpt( E3, 1.7, 1.2, 0.0 ),
  3777.                                    ctlpt( E3, 1.9, 1.4, 1.2 ),
  3778.                                    ctlpt( E3, 1.2, 1.6, 2.4 ) ),
  3779.                              list( ctlpt( E3, 1.4, 2.3, 0.9 ),
  3780.                                    ctlpt( E3, 1.6, 2.5, 1.7 ),
  3781.                                    ctlpt( E3, 1.8, 2.7, 2.5 ) ) ) ) );
  3782.  
  3783.  creats a trivariate Bezier which is linear in the first direction, and
  3784.  quadratic in the second and third.
  3785. $
  3786.  
  3787. TBSPLINE
  3788.  
  3789.  TrivarType TBSPLINE( NumericType UOrder,
  3790.                       NumericType VOrder,
  3791.                       NumericType WOrder,
  3792.                       ListType CtlMesh,
  3793.                       ListType KnotVectors )
  3794.  
  3795.    Creates a Bspline trivariate with the provided UOrder, VOrder
  3796.  and WOrder orders, the control mesh CtlMesh, and the three knot
  3797.  vectors in KnotVectors.
  3798.    CtlMesh is a list of planes, each of which is a list of rows, each
  3799.  of which is a list of control points. All control points must be of point
  3800.  type (E1-E5, P1-P5), or regular PointType defining the trivariate's control
  3801.  mesh. Trivariate's point type will be of a space which is the union of the
  3802.  spaces of all points.
  3803.    KnotVectors is a list of three knot vectors. Each knot vector is a
  3804.  list of NumericType knots of length #CtlPtList plus the Order.
  3805.  If, however, the length of the knot vector is equal to #CtlPtList +
  3806.  Order + Order - 1} the curve is assumed periodic. 
  3807.    The knot vector may also be a list of a single constant KV_OPEN or
  3808.  KV_FLOAT or KV_PERIODIC, in which a uniform knot vector with the
  3809.  appropriate length and with open, floating or periodic end condition
  3810.  will be constructed automatically.
  3811.  
  3812.  Example:
  3813.  
  3814.    TV = TBSPLINE( 2, 2, 2,
  3815.                   list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
  3816.                                     ctlpt( E3, 0.2, 0.5, 1.1 ),
  3817.                                     ctlpt( E3, 0.3, 0.1, 2.2 ) ),
  3818.                               list( ctlpt( E3, 0.4, 1.3, 0.5 ),
  3819.                                     ctlpt( E3, 0.5, 1.7, 1.7 ),
  3820.                                     ctlpt( E3, 0.6, 1.3, 2.9 ) ),
  3821.                               list( ctlpt( E3, 0.7, 2.4, 0.5 ),
  3822.                                     ctlpt( E3, 0.8, 2.6, 1.4 ),
  3823.                                     ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
  3824.                         list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
  3825.                                     ctlpt( E3, 1.3, 0.2, 1.7 ),
  3826.                                     ctlpt( E3, 1.5, 0.3, 2.9 ) ),
  3827.                               list( ctlpt( E3, 1.7, 1.2, 0.0 ),
  3828.                                     ctlpt( E3, 1.9, 1.4, 1.2 ),
  3829.                                     ctlpt( E3, 1.2, 1.6, 2.4 ) ),
  3830.                               list( ctlpt( E3, 1.4, 2.3, 0.9 ),
  3831.                                     ctlpt( E3, 1.6, 2.5, 1.7 ),
  3832.                                     ctlpt( E3, 1.8, 2.7, 2.5 ) ) ) ),
  3833.                   list( list( KV_OPEN ),
  3834.                         list( KV_OPEN ),
  3835.                         list( KV_OPEN ) ) );
  3836.  
  3837.  constructs a trilinear Bspline trivariate with open end conditions.
  3838. $
  3839.  
  3840. TDERIVE
  3841.  
  3842.  TrivarType TDERIVE( TrivarType TV, NumericType Dir )
  3843.  
  3844.    Returns a vector field trivariate representing the differentiated 
  3845.  trivariate in the given direction (ROW, COL, or DEPTH). Evaluation of the
  3846.  returned trivariate at a given parameter value will return a vector
  3847.  representing the partial derivative of TV in Dir at that
  3848.  parameter value.
  3849.  
  3850.  TV = tbezier( list( list( list( ctlpt( E1, 0.1 ),
  3851.                                  ctlpt( E1, 0.2 ) ),
  3852.                            list( ctlpt( E1, 0.3 ),
  3853.                                  ctlpt( E1, 0.4 ) ) ),
  3854.                      list( list( ctlpt( E1, 2.4 ),
  3855.                                  ctlpt( E1, 2.2 ) ),
  3856.                            list( ctlpt( E1, 2.3 ),
  3857.                                  ctlpt( E1, 2.1 ) ) ) ) );
  3858.  
  3859.  DuTV = TDERIVE( TV, ROW );
  3860.  DvTV = TDERIVE( TV, COL );
  3861.  DwTV = TDERIVE( TV, DEPTH );
  3862.  
  3863.  computes the gradiate of a scalar trivariate field, by computing its
  3864.  partials with respect to u, v, and w.
  3865. $
  3866.  
  3867. TDIVIDE
  3868.  
  3869.  TrivarType TDIVIDE( TrivarType TV, ConstantType Direction,
  3870.                                                           NumericType Param )
  3871.  
  3872.    Subdivides a trivariate into two at the specified parameter value Param
  3873.  in the specified Direction (ROW, COL, or DEPTH). TV can be either
  3874.  a Bspline trivairate in which Param must be conatined in the parametric
  3875.  domain of the trivariate, or a Bezier trivariate in which Param must be
  3876.  in the range of zero to one.
  3877.  
  3878.    It returns a list of the two sub-trivariates. The individual trivariates
  3879.  may be extracted from the list using the NTH command.
  3880.  
  3881.  Example:
  3882.  
  3883.     TvDiv = TDIVIDE( Tv2, depth, 0.3 );
  3884.     Tv2a = nth( TvDiv, 1 ) * tx( -2.2 );
  3885.     Tv2b = nth( TvDiv, 2 ) * tx( 2.0 );
  3886.  
  3887.  subdivides Tv2 at the parameter value of 0.3 in the DEPTH direction,
  3888. $
  3889.  
  3890. TEVAL
  3891.  
  3892.  CtlPtType TEVAL( TrivarType TV,
  3893.                   NumericType UParam,
  3894.                   NumericType VParam,
  3895.                   NumericType WParam )
  3896.  
  3897.    Evaluates the provided trivariate TV at the given UParam,
  3898.  VParam  and WParam values. UParam, VParam,
  3899.  WParam must be contained in the surface parametric domain if TV
  3900.  is a Bspline surface, or between zero and one if TV is a Bezier
  3901.  trivariate. The returned control point has the same type as the control
  3902.  points of TV.
  3903.  
  3904.  Example:
  3905.  
  3906.     CPt = TEVAL( TV1, 0.25, 0.22, 0.7 );
  3907.  
  3908.  evaluates TV at the parameter values of (0.25, 0.22, 0.7).
  3909. $
  3910.  
  3911. TEXTGEOM
  3912.  
  3913.  AnyType TEXTGEOM( StringType Str, VectorType Spacing, NumericType Scaling )
  3914.  
  3915.  Creates a displayable geometry that represents the text in Str, with
  3916.  Spacing space between individual characters. Each character is scaled
  3917.  by Scaling where scaling of one generates a close to a unit size
  3918.  character.
  3919.  
  3920.  Example:
  3921.  
  3922.     a = TEXTGEOM("Text", vector( 0.12, 0, 0 ), 0.1 );
  3923.     b = TEXTGEOM("IRIT", vector( 0, -0.12, 0 ), 0.1 );
  3924.  
  3925.  Creates an horizontal Text and a vertical top to bottom IRIT,
  3926.  both as geometrical objects.
  3927. $
  3928.  
  3929. TFROMSRFS
  3930.  
  3931.  TrivarType TFROMSRFS( ListType SrfList, NumericType OtherOrder )
  3932.  
  3933.    Constructs a trivariate by substituting the surfaces in SrfList as
  3934.  planes in a control mesh of a trivariate. Surfaces in SrfList are
  3935.  made compatible by promoting Bezier surfaces to Bsplines if necessary,
  3936.  and raising degree and refining as required before substituting the
  3937.  control meshes of the surfaces as planes in the mesh of the trivariate.
  3938.  The other, third, direction order is set by OtherOrder, which cannot
  3939.  be larger than the number of surfaces.
  3940.  
  3941.    The trivariate interpolates the first and last surfaces only.
  3942.  
  3943.  Example:
  3944.  
  3945.     s1 = sbezier( list( list( ctlpt( E3, -0.5, -0.5, 0 ),
  3946.                               ctlpt( E3, -0.5,  0.5, 0 ) ),
  3947.                         list( ctlpt( E3,  0.5, -0.5, 0 ),
  3948.                               ctlpt( E3,  0.5,  0.5, 0 ) ) ) ) * sc( 0.3 );
  3949.     Srfs = list( s1 * sc( 2.0 ),
  3950.                  s1 * sx( 1.4 ) * ry( 45 ) * tz( 1.0 ),
  3951.                  s1 * ry( 90 ) * trans( vector( 1.0, 0.0, 1.1 ) ),
  3952.                  s1 * sx( 1.4 ) * ry( 135 ) * trans( vector( 2.0, 0.0, 1.0 ) ),
  3953.                  s1 * sc( 2.0 ) * ry( 180 ) * trans( vector( 2.0, 0.0, 0.0 ) ) );
  3954.     color( Srfs, red );
  3955.  
  3956.     ts = tfromsrfs( Srfs, 3 );
  3957.     color( ts, green );
  3958.     view( list( Srfs, ts ), on );
  3959.  
  3960.  Constructs a trivariate from five planar surfaces and display both the
  3961.  trivariate and the five planar surfaces, in different colors.
  3962. $
  3963.  
  3964. TINTERP
  3965.  
  3966.  TrivarType TINTERP( TrivarType TV );
  3967.  
  3968.    Given a trivariate data structure, computes a new trivariate in the
  3969.  same function space (i.e. same knot sequences and orders) that interpolates
  3970.  the given triavriate, TV, at the node parameter values.
  3971.  
  3972.  Example:
  3973.  
  3974.      tv = tbspline( 3, 3, 2,
  3975.                     list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
  3976.                                       ctlpt( E3, 0.2, 0.5, 1.1 ),
  3977.                                       ctlpt( E3, 0.3, 0.1, 2.2 ) ),
  3978.                                 list( ctlpt( E3, 0.4, 1.3, 0.5 ),
  3979.                                       ctlpt( E3, 0.5, 1.7, 1.7 ),
  3980.                                       ctlpt( E3, 0.6, 1.3, 2.9 ) ),
  3981.                                 list( ctlpt( E3, 0.7, 2.4, 0.5 ),
  3982.                                       ctlpt( E3, 0.8, 2.6, 1.4 ),
  3983.                                       ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
  3984.                           list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
  3985.                                       ctlpt( E3, 1.3, 0.2, 1.7 ),
  3986.                                       ctlpt( E3, 1.5, 0.3, 2.9 ) ),
  3987.                                 list( ctlpt( E3, 1.7, 1.2, 0.0 ),
  3988.                                       ctlpt( E3, 1.9, 1.4, 1.2 ),
  3989.                                       ctlpt( E3, 1.2, 1.6, 2.4 ) ),
  3990.                                 list( ctlpt( E3, 1.4, 2.3, 0.9 ),
  3991.                                       ctlpt( E3, 1.6, 2.5, 1.7 ),
  3992.                                       ctlpt( E3, 1.8, 2.7, 2.5 ) ) ),
  3993.                           list( list( ctlpt( E3, 2.8, 0.1, 0.4 ),
  3994.                                       ctlpt( E3, 2.6, 0.7, 1.3 ),
  3995.                                       ctlpt( E3, 2.4, 0.2, 2.2 ) ),
  3996.                                 list( ctlpt( E3, 2.2, 1.1, 0.4 ),
  3997.                                       ctlpt( E3, 2.9, 1.2, 1.5 ),
  3998.                                       ctlpt( E3, 2.7, 1.3, 2.6 ) ),
  3999.                                 list( ctlpt( E3, 2.5, 2.9, 0.7 ),
  4000.                                       ctlpt( E3, 2.3, 2.8, 1.7 ),
  4001.                                       ctlpt( E3, 2.1, 2.7, 2.7 ) ) ) ),
  4002.                     list( list( KV_OPEN ),
  4003.                           list( KV_OPEN ),
  4004.                           list( KV_OPEN ) ) );
  4005.     tvi = TINTERP( tv );
  4006.  
  4007.  creates a quadratic by quaratic by linear trivairatiate tvi that
  4008.  interpolates the control points of tv at the node parameter values.
  4009. $
  4010.  
  4011. TORUS
  4012.  
  4013.  PolygonType TORUS( VectorType Center, VectorType Normal,
  4014.                     NumericType MRadius, NumericType mRadius )
  4015.  
  4016.    Creates a TORUS geometric object, defined by Center as the center
  4017.  of the TORUS, Normal as the normal to the main plane of the TORUS,
  4018.  MRadius and mRadius as the major and minor radii of the TORUS.
  4019.    See RESOLUTION for the accuracy of the TORUS approximation as a polygonal
  4020.  model. 
  4021.  
  4022.  Example:
  4023.  
  4024.     T = TORUS( vector( 0.0, 0.0, 0.0), vector( 0.0, 0.0, 1.0), 0.5, 0.2 );
  4025.  
  4026.  constructs a torus with major plane as the XY plane, major radius of 0.5,
  4027.  and minor radius of 0.2.
  4028. $
  4029.  
  4030. TREFINE
  4031.  
  4032.  TrivarType TREFINE( TrivarType TV, ConstantType Direction,
  4033.                      NumericType Replace, ListType KnotList )
  4034.  
  4035.    Provides the ability to Replace a knot vector of TV or refine 
  4036.  it in the specified direction Direction (ROW, COL, or DEPTH).
  4037.    KnotList is a list of knots to refine TV at. All knots should be
  4038.  contained in the parametric domain of TV in Direction. If the knot
  4039.  vector is replaced, the length of KnotList should be identical to the
  4040.  length of the original knot vector of TV in Direction. If TV
  4041.  is a Bezier trivariate, it is automatically promoted to be a Bspline
  4042.  trivariate.
  4043.  
  4044.  Example:
  4045.  
  4046.     TV = TREFINE( TREFINE( TREFINE( TV,
  4047.                                     ROW, FALSE, list( 0.333, 0.667 ) ),
  4048.                            COL, FALSE, list( 0.333, 0.667 ) ),
  4049.                   DEPTH, FALSE, list( 0.333, 0.667 ) );
  4050.  
  4051.  refines TV in all directions by adding two more knots at 0.333 and
  4052.  0.667.
  4053. $
  4054.  
  4055. TREGION
  4056.  
  4057.  TrivarType TREGION( TrivarType Srf, ConstantType Direction,
  4058.                      NumericType MinParam, NumericType MaxParam )
  4059.  
  4060.    Extracts a region of TV between MinParam and MaxParam
  4061.  in the specified Direction. Both MinParam and MaxParam
  4062.  should be contained in the parametric domain of TV in Direction.
  4063.  
  4064.  Example:
  4065.  
  4066.     Tv1 = tbezier( list( list( list( ctlpt( E3, 0.1, 0.0, 0.8 ),
  4067.                                      ctlpt( E3, 0.2, 0.1, 2.4 ) ),
  4068.                                list( ctlpt( E3, 0.3, 2.2, 0.2 ),
  4069.                                      ctlpt( E3, 0.4, 2.3, 2.0 ) ) ),
  4070.                          list( list( ctlpt( E3, 2.4, 0.8, 0.1 ),
  4071.                                      ctlpt( E3, 2.2, 0.7, 2.3 ) ),
  4072.                                list( ctlpt( E3, 2.3, 2.6, 0.5 ),
  4073.                                      ctlpt( E3, 2.1, 2.5, 2.7) ) ) ) );
  4074.  
  4075.     Tv1r1 = TREGION( Tv1, row, 0.1, 0.2 );
  4076.     Tv1r2 = TREGION( Tv1, row, 0.4, 0.6 );
  4077.     Tv1r3 = TREGION( Tv1, row, 0.99, 1.0 );
  4078.  
  4079.  extracts three regions of Tv1 along the ROW direction.
  4080. $
  4081.  
  4082. TRIMSRF
  4083.  
  4084.  TrimSrfType TRIMSRF( SurfaceType Srf,
  4085.                       CurveType TrimCrv,
  4086.                       NumericType HasUpperLevel )
  4087.  
  4088.  or
  4089.  
  4090.  TrimSrfType TRIMSRF( SurfaceType Srf,
  4091.                       ListType TrimCrvs,
  4092.                       NumericType HasUpperLevel )
  4093.  
  4094.    Creates a trimmed surface from the provided surface Srf and the
  4095.  trimming curve TrimCrv or curves TrimCrvs. If HasUpperLevel
  4096.  is FALSE, an additional trimming curve is automatically being added that
  4097.  contains the entire parametric domain of Srf. No validity test is
  4098.  performed on the trimming curves which are assumed two dimensional curves
  4099.  contained in the parametric domain of Srf.
  4100.  
  4101.  Example:
  4102.  
  4103.     spts = list( list( ctlpt( E3, 0.1, 0.0, 1.0 ),
  4104.                        ctlpt( E3, 0.3, 1.0, 0.0 ),
  4105.                        ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  4106.                  list( ctlpt( E3, 1.1, 0.0, 0.0 ),
  4107.                        ctlpt( E3, 1.3, 1.5, 2.0 ),
  4108.                        ctlpt( E3, 1.0, 2.1, 0.0 ) ),
  4109.                  list( ctlpt( E3, 2.1, 0.0, 2.0 ),
  4110.                        ctlpt( E3, 2.3, 1.0, 0.0 ),
  4111.                        ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  4112.                  list( ctlpt( E3, 3.1, 0.0, 0.0 ),
  4113.                        ctlpt( E3, 3.3, 1.5, 2.0 ),
  4114.                        ctlpt( E3, 3.0, 2.1, 0.0 ) ),
  4115.                  list( ctlpt( E3, 4.1, 0.0, 1.0 ),
  4116.                        ctlpt( E3, 4.3, 1.0, 0.0 ),
  4117.                        ctlpt( E3, 4.0, 2.0, 1.0 ) ) );
  4118.     sb = sbspline( 3, 3, spts, list( list( KV_OPEN ), list( KV_OPEN ) ) );
  4119.     
  4120.     TCrv1 = cbspline( 2,
  4121.                       list( ctlpt( E2, 0.3, 0.3 ),
  4122.                             ctlpt( E2, 0.7, 0.3 ),
  4123.                             ctlpt( E2, 0.7, 0.7 ),
  4124.                             ctlpt( E2, 0.3, 0.7 ),
  4125.                             ctlpt( E2, 0.3, 0.3 ) ),
  4126.                       list( KV_OPEN ) );
  4127.     TCrv2 = circle( vector( 0.5, 0.5, 0.0 ), 0.25 );
  4128.     TCrv3 = cbspline( 3,
  4129.                       list( ctlpt( E2, 0.3, 0.3 ),
  4130.                             ctlpt( E2, 0.7, 0.3 ),
  4131.                             ctlpt( E2, 0.7, 0.7 ),
  4132.                             ctlpt( E2, 0.3, 0.7 ) ),
  4133.                       list( KV_PERIODIC ) );
  4134.     
  4135.     TSrf1 = TRIMSRF( sb, TCrv1, false );
  4136.     TSrf2 = TRIMSRF( sb, TCrv1, true );
  4137.     TSrf3 = TRIMSRF( sb, list( TCrv1, TcRv2 * ty( 1 ), TCrv3 * ty( 2 ) ),
  4138.                      false );
  4139.  
  4140.  constructs three trimmed surfaces. Tsrf1 contains the outer boundary
  4141.  and excludes what is inside TCrv1, TSrf2 contains only the
  4142.  domain inside TCrv1. TCrv3 has three holes corresponds to the
  4143.  three trimming curves.
  4144. $
  4145.  
  4146.  
  4147. Object transformation functions
  4148.  
  4149.  All the routines in this section construct a 4 by 4 homogeneous
  4150.  transformation matrix representing the required transform. These matrices
  4151.  may be concatenated to achieve more complex transforms using the matrix
  4152.  multiplication operator *. For example, the expression
  4153.  
  4154.     m = trans( vector( -1, 0, 0 ) ) * rotx( 45 ) * trans( vector( 1, 0, 0 ) );
  4155.  
  4156.  constructs a transform to rotate an object around the X = 1 line, 45 degrees.
  4157.  A matrix representing the inverse transformation can be computed as:
  4158.     InvM = m ^ -1
  4159.  See also overloading of the - operator.
  4160. $
  4161.  
  4162. HOMOMAT
  4163.  
  4164.  MatrixType HOMOMAT( ListType MatData )
  4165.  
  4166.    Creates an arbitrary homogeneous transformation matrix by manually providing
  4167.  its 16 coefficients.
  4168.  Example:
  4169.  
  4170.  for ( a = 1, 1, 720 / step,
  4171.        view_mat = save_mat *
  4172.                   HOMOMAT( list( list( 1, 0, 0, 0 ),
  4173.                                  list( 0, 1, 0, 0 ),
  4174.                                  list( 0, 0, 1, -a * step / 500 ),
  4175.                                  list( 0, 0, 0, 1 ) ) ):
  4176.        view( list( view_mat, axes ), on )
  4177.  );
  4178.  
  4179.  looping and viewing through a sequence of perspective transforms, created
  4180.  using the HOMOMAT constructor.
  4181. $
  4182.  
  4183. ROTVEC
  4184.  
  4185.  MatrixType ROTVEC( VectorType Vec, NumericType Angle )
  4186.  
  4187.    Creates a rotation around the vector Vec matrix with Angle degrees.
  4188. $
  4189.  
  4190. ROTX
  4191.  
  4192.  MatrixType ROTX( NumericType Angle )
  4193.  
  4194.    Creates a rotation around the X transformation matrix with Angle degrees.
  4195. $
  4196.  
  4197. ROTY
  4198.  
  4199.  MatrixType ROTY( NumericType Angle )
  4200.  
  4201.    Creates a rotation around te Y transformation matrix with Angle degrees.
  4202. $
  4203.  
  4204. ROTZ
  4205.  
  4206.  MatrixType ROTZ( NumericType Angle )
  4207.  
  4208.    Creates a rotation around the Z transformation matrix with Angle degrees.
  4209. $
  4210.  
  4211. ROTZ2V
  4212.  
  4213.  MatrixType ROTZ2V( VectorType Dir )
  4214.  
  4215.    Creates a rotation matrix that takes Z axis into Dir. Length of Dir
  4216.  is ignored.
  4217. $
  4218.  
  4219. ROTZ2V2
  4220.  
  4221.  MatrixType ROTZ2V2( VectorType Dir, VectorType Dir2 )
  4222.  
  4223.    Creates a rotation matrix that takes Z axis into Dir, while the X axis
  4224.  is aligned with Dir2. The lengths of Dir and Dir2 are ignored.
  4225. $
  4226.  
  4227. SCALE
  4228.  
  4229.  MatrixType SCALE( VectorType ScaleFactors )
  4230.  
  4231.    Creates a scaling by the ScaleFactors transformation matrix.
  4232. $
  4233.  
  4234. TRANS
  4235.  
  4236.  MatrixType TRANS( VectorType TransFactors )
  4237.  
  4238.    Creates a translation by the TransFactors transformation matrix.
  4239. $
  4240.  
  4241. General purpose functions  
  4242. $
  4243.  
  4244. ATTRIB
  4245.  
  4246.  ATTRIB( AnyType Object, StringType Name, AnyType Value )
  4247.  
  4248.    Provides a mechanism to add an attribute of any type to an Object,
  4249.  with name Name and value Value. This ATTRIB function is tuned
  4250.  and optimized toward numeric values or strings as Value although any
  4251.  other object type can be saved as attribue.
  4252.  
  4253.    These attributes may be used to pass information to other programs about
  4254.  this object, and are saved with the objects in data files. For example,
  4255.  
  4256.     ATTRIB(Glass, "rgb", "255,0,0");
  4257.     ATTRIB(Glass, "refract", "1.4");
  4258.         .
  4259.         .
  4260.         .
  4261.     RMATTR(Glass, "rgb");   # Removes "rgb" attribute.
  4262.  
  4263.  sets the RGB color and refraction index of the Glass object and
  4264.  later removes the RGB attribute.
  4265.  
  4266.    Attribute names are case insensitive. Spaces are allowed in the Value
  4267.  string, as well as the double quote itself, although the latter must be
  4268.  escaped:
  4269.  
  4270.     ATTRIB(Glass, "text", "Say "this is me"");
  4271.  
  4272.    See also RMATTR for removal of attributes as well as AWIDTH, ADWIDTH, and
  4273.  COLOR.
  4274. $
  4275.  
  4276. ADWIDTH
  4277.  
  4278.  ADWIDTH( GeometricType Object, NumericType DWidth )
  4279.  
  4280.    Sets the width of the object.  This display width is used in pixels in
  4281.  display devices for width of line drawing, if supported by the display device.
  4282.    See also ATTRIB, COLOR, and AWIDTH.
  4283.  
  4284.    This function is equivament to using,
  4285.  
  4286.                          ATTRIB( Object, "dwidth", Width );
  4287. $
  4288.  
  4289. AWIDTH
  4290.  
  4291.  AWIDTH( GeometricType Object, NumericType Width )
  4292.  
  4293.    Sets the width of the object to one of those specified below.  This width
  4294.  is used in real object side dimensions in tools such as scan converters and
  4295.  rendering tools for rendering lines and curves, as well as postscript.
  4296.    See also ATTRIB, COLOR, and ADWIDTH.
  4297.  
  4298.    This function is equivament to using,
  4299.  
  4300.                          ATTRIB( Object, "width", Width );
  4301. $
  4302.  
  4303. CHDIR
  4304.  
  4305.  CHDIR( StringType NewDir )
  4306.  
  4307.    Sets the current working directory to be NewDir.
  4308. $
  4309.  
  4310. CLNTCLOSE
  4311.  
  4312.  CLNTCLOSE( NumericType Handler, NumericType Kill )
  4313.  
  4314.    Closes a communication channel to a client. Handler contains the
  4315.  index of the communication channel opened via CLNTEXEC. If Kill, the
  4316.  client is send an  exit request for it to die. Otherwise, the communication
  4317.  is closed and the client is running stand alone.  See also CLNTREAD,
  4318.  CLNTWRITE, and CLNTEXEC.
  4319.  
  4320.  Example:
  4321.  
  4322.    h2 = clntexec( "nuldrvs -s-" );
  4323.        .
  4324.        .
  4325.        .
  4326.  
  4327.    CLNTCLOSE( h2,TRUE );
  4328.  
  4329.  closes the connection to the nuldrvs client, opened via CLNTEXEC.
  4330. $
  4331.  
  4332. CLNTWRITE
  4333.  
  4334.  CLNTWRITE( NumericType Handler, AnyType Object )
  4335.  
  4336.    Writes one object Object to a communication channel of a client.
  4337.  Handler contains the index of the communication channel opened via
  4338.  CLNTEXEC.  See also CLNTREAD, CLNTCLOSE, and CLNTEXEC.
  4339.  
  4340.  Example:
  4341.  
  4342.    h2 = clntexec( "nuldrvs -s-" );
  4343.        .
  4344.        .
  4345.  
  4346.    CLNTWRITE( h2, Model );
  4347.        .
  4348.        .
  4349.  
  4350.    clntclose( h2,TRUE );
  4351.  
  4352.  writes the object named Model to client through communication channel h2.
  4353. $
  4354.  
  4355. COLOR
  4356.  
  4357.  COLOR( GeometricType Object, NumericType Color )
  4358.  
  4359.    Sets the color of the object to one of those specified below. Note that an
  4360.  object has a default color (see IRIT.CFG file) according to its origin -
  4361.  loaded with the LOAD command, PRIMITIVE, or BOOLEAN operation result.
  4362.    The system internally supports colors (although you may have a B&W system)
  4363.  and the colors recognized are:
  4364.  BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, and WHITE.
  4365.  
  4366.    See the ATTRIB command for more fine control of colors using the RGB
  4367.  attribute. See also AWIDTH and AWIDTH.
  4368.  
  4369.    This function is equivament to using,
  4370.  
  4371.                          ATTRIB( Object, "color", Width );
  4372. $
  4373.  
  4374. COMMENT
  4375.  
  4376.  COMMENT
  4377.  
  4378.  Two types of comments are allowed:
  4379.  
  4380.  1. One-line comment: starts anywhere in a line at the '#' character, up to
  4381.     the end of the line.
  4382.  
  4383.  2. Block comment: starts at the COMMENT keyword followed by a unique
  4384.     character (anything but white space), up to the second occurrence of that
  4385.     character. This is a fast way to comment out large blocks.
  4386.  
  4387.  Example:
  4388.  
  4389.     COMMENT 
  4390.       This is a comment
  4391.     
  4392. $
  4393.  
  4394. ERROR
  4395.  
  4396.  ERROR( StringType Message);
  4397.  
  4398.  Breaks the execution and returns to IRIT main loop, after printing
  4399.  Message to the screen. May be useful in user defined function to
  4400.  break execution in cases of fatal errors.
  4401. $
  4402.  
  4403. EXIT
  4404.  
  4405.  EXIT();
  4406.  
  4407.    Exits from the solid modeler. NO warning is given!
  4408. $
  4409.  
  4410. FOR
  4411.  
  4412.  FOR( NumericType Start, NumericType Increment, NumericType End, AnyType Body )
  4413.  
  4414.    Executes the Body (see below), while the FOR loop conditions hold.
  4415.    Start, Increment, End are evaluated first, and the loop is executed
  4416.  while <= End if Increment > 0, or while >= End if Increment < 0.
  4417.    If Start is of the form "Variable = Expression", then that variable is
  4418.  updated on each iteration, and can be used within the body.
  4419.    The body may consist of any number of regular commands, separated by
  4420.  COLONs, including nesting FOR loops to an arbitrary level.
  4421.  
  4422.  Example:
  4423.  
  4424.  step = 10;
  4425.  rotstepx = rotx(step);
  4426.  FOR ( a = 1, 1, 360 / step,
  4427.      view_mat = rotstepx * view_mat:
  4428.      view( list( view_mat, axes ), ON )
  4429.  );
  4430.  
  4431.  Displays axes with a view direction that is rotated 10 degrees at a
  4432.  time around the X axis.
  4433. $
  4434.  
  4435. HELP
  4436.  
  4437.  HELP( StringType Subject )
  4438.  
  4439.    Provides help on the specified Subject.
  4440.  
  4441.  Example:
  4442.  
  4443.     HELP("");
  4444.  
  4445.  will list all IRIT help subjects.
  4446. $
  4447.  
  4448. FREE
  4449.  
  4450.  FREE( GeometricType Object )
  4451.  
  4452.    Because of the usually huge size of geometric objects, this procedure
  4453.  may be used to free them. Reassigning a value (even of different type)
  4454.  to a variable automatically releases the old variable's allocated space
  4455.  as well.
  4456. $
  4457.  
  4458. FUNCTION
  4459.  
  4460.  FuncName = FUNCTION(Prm1, Prm2, ... , PrmN):LclVal1:LclVar2: ... :LclVarM:
  4461.      FuncBody;
  4462.  
  4463.  Defines a function named FuncName with N parameters and M local variables
  4464.  (N, M >= 0). Here is a (simple) example of a function with no local variables
  4465.  and a single parameter that computes the square of a number:
  4466.  
  4467.  sqr = FUNCTION(x):
  4468.     return = x * x;
  4469.  
  4470.    Functions can be defined with optional parameters and optional local
  4471.  variables. A function's body may contain an arbitrary set of expressions
  4472.  including for/while loops, (user) function calls, or even recursive function
  4473.  calls, all separated by colons.
  4474.    The returned value of the function is the value of an automatically defined
  4475.  local variable named return. The return variable is a regular local variable
  4476.  within the scope of the function and can be used as any other variable.
  4477.  
  4478.    If a variable's name is found in neither the local variable list nor
  4479.  the parameter list, it is searched in the global variable list (outside
  4480.  the scope of the function). Binding of names of variables is static as in the
  4481.  C programming language.
  4482.  
  4483.    Because binding of variables is performed in execution time, there is a
  4484.  somewhat less restrictive type checking of parameters of functions that are
  4485.  invoked within a user's defined function.
  4486.  
  4487.    A function can invoke itself, i.e., it can be recursive. However, since a
  4488.  function should be defined when it is called, a dummy function should be
  4489.  defined before the recursive one is defined:
  4490.  
  4491.  factorial = function(x):return = x; # Dummy function.
  4492.  factorial = function(x):
  4493.      if (x <= 1, return = 1, return = x * factorial(x - 1));
  4494.  
  4495.    Overloading is valid inside a function as it is outside. For example, for
  4496.  
  4497.  add = FUNCTION(x, y):
  4498.     return = x + y;
  4499.  
  4500.  the following function calls are all valid:
  4501.  
  4502.  add(1, 2);
  4503.  add(vector(1,2,3), point(1,2,3));
  4504.  add(box(vector(-3, -2, -1), 6, 4, 2), box(vector(-4, -3, -2), 2, 2, 4));
  4505.  
  4506.  Finally, here is a more interesting example that computes an approximation
  4507.  of the length of a curve, using the sqr function defined above:
  4508.  
  4509.  distptpt = FUNCTION(pt1, pt2):
  4510.      return = sqrt(sqr(coord(pt1, 1) - coord(pt2, 1)) +
  4511.                    sqr(coord(pt1, 2) - coord(pt2, 2)) +
  4512.                    sqr(coord(pt1, 3) - coord(pt2, 3)));
  4513.  
  4514.  crvlength = FUNCTION(crv, n):pd:t:t1:t2:dt:pt1:pt2:i:
  4515.      return = 0.0:
  4516.      pd = pdomain(crv):
  4517.      t1 = nth(pd, 1):
  4518.      t2 = nth(pd, 2):
  4519.      dt = (t2 - t1) / n:
  4520.      pt1 = coerce(ceval(crv, t1), e3):
  4521.      for (i = 1, 1, n,
  4522.           pt2 = coerce(ceval(crv, t1 + dt * i), e3):
  4523.           return = return + distptpt(pt1, pt2):
  4524.           pt1 = pt2);
  4525.  
  4526.  Try, for example:
  4527.  
  4528.  crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 30) / 2;
  4529.  crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 100) / 2;
  4530.  crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 300) / 2;
  4531.  
  4532.  See PROCEDURE and IRITSTATE's "DebugFunc" for more.
  4533. $
  4534.  
  4535. IF
  4536.  
  4537.  IF( NumericType Cond, AnyType TrueBody { , AnyType FalseBody } )
  4538.  
  4539.    Executes TrueBody (group of regular commands, separated by COLONs -
  4540.  see FOR loop) if the Cond holds, i.e., it is a numeric value other than
  4541.  zero, or optionally, if it exists, executes FalseBody if the Cond
  4542.  does not hold, i.e., it evaluates to a numeric value equal to zero.
  4543.  
  4544.  Examples:
  4545.  
  4546.     IF ( machine == IBMOS2, resolution = 5, resolution = 10 );
  4547.     IF ( a > b, max = a, max = b );
  4548.  
  4549.  sets the resolution to be 10, unless running on an IBMOS2 system, in which
  4550.  case the RESOLUTION variable will be set to 5 in the first statement, and
  4551.  set max to the maximum of a and b in the second statement.
  4552. $
  4553.  
  4554. INCLUDE
  4555.  
  4556.  INCLUDE( StringType FileName )
  4557.  
  4558.    Executes the script file FileName. Nesting of include file is allowed up
  4559.  to 10 levels deep. If an error occurs, all open files in all nested files
  4560.  are closed and data are waited for at the top level (standard input).
  4561.  
  4562.    A script file can contain any command the solid modeler supports.
  4563.  
  4564.  Example:
  4565.  
  4566.     INCLUDE( "general.irt" );
  4567.  
  4568.  includes the file "general.irt".
  4569. $
  4570.  
  4571. IRITSTATE
  4572.  
  4573.  IRITSTATE( StringType State, AnyType Data )
  4574.  
  4575.    Sets a state variable in the IRIT solid modeller. Current supported
  4576.  state variables are,
  4577.  
  4578.     State Name   Data Type    Comments    
  4579.                                           
  4580.     InterpProd   ConstantType TRUE for Bspline sym. products via interpolation
  4581.                               FALSE for Bspline sym. products via bezier
  4582.     DebugMalloc  StringType   If "Reset", memory allocation is cleared/reset.
  4583.                               No "Free unallocated pointer" test after "Reset".
  4584.                               If "Print", all allocated blocks are printed.
  4585.                               Otherwise, used as "address, n": ptr address to
  4586.                               search for with abort() called after n mallocs.
  4587.     DebugFunc    NumericType  >0 user func. debug information. >2 print params
  4588.                               on entry, ret. val. on exit. >4 global var. list
  4589.     FloatFrmt    StringType   Specifies a new printf floating point format.
  4590.     InterCrv     NumericType  If TRUE Boolean operations creates only
  4591.                               intersection curves. If FALSE, full Boolean
  4592.                               operation results.
  4593.     Coplanar     NumericType  If TRUE, Coplanar polygons are handled by Boolean
  4594.                               operations. 
  4595.     PolySort     NumericType  Axis of Polygon Intersection sweep in Boolean
  4596.                               operations: 0 for X axis, 1 for Y axis, 2 for
  4597.                               Z axis.     
  4598.     EchoSource   NumericType  If TRUE, irit scripts are echoed to stdout.
  4599.     DumpLevel    NumericType  Controls the way variables/expressions ar dumped.
  4600.                               Only object names/types if >= 0, Scalars and
  4601.                               vectors are dumped if >= 1, Curves and Surfaces
  4602.                               are dumped if DumpLvl >= 2, Polygons/lines are
  4603.                               dumped if DumpLvl >= 3, and List objects are
  4604.                               traversed recursively if DumpLvl >= 4.
  4605.     TrimCrvs     NumericType  Number of samples the higher order trimmed curves
  4606.                               are sampled, in piecewise linear approximation.
  4607.                               If zero, computed symbolically as composition.
  4608.     UVBoolean    NumericType  If TRUE, Boolean between surfaces returns UV
  4609.                               instead of Euclidean curves.
  4610.  
  4611.  
  4612.  Example:
  4613.  
  4614.     IRITSTATE( "DebugFunc", 3 );
  4615.     IRITSTATE( "FloatFrmt", "%8.5lg" );
  4616.  
  4617.  To print parameters of user defined functions on entry, and return value on
  4618.  exit. Also selects a floating point printf format of "%8.5lg".
  4619. $
  4620.  
  4621. INTERACT
  4622.  
  4623.  INTERACT( GeometryTreeType Object )
  4624.  
  4625.    A user-defined function (see iritinit.irt) that does the following,
  4626.  in order:
  4627.  Clear the display device.
  4628.  Display the given Object.
  4629.  Pause for a keystroke.
  4630.  
  4631.    This user-defined function in version 4.0 of IRIT is an
  4632.  emulation of the INTERACT function that used to exist in previous versions.
  4633.  
  4634.  Example:
  4635.  
  4636.  INTERACT( list( view_mat, Axes, Obj ) );
  4637.  
  4638.  displays and interacts with the object Obj and the predefined object
  4639.  Axes. VIEW_MAT will be used to set the starting transformation.
  4640.  
  4641.    See VIEW and VIEWOBJ for more.
  4642. $
  4643.  
  4644. LIST
  4645.  
  4646.  ListType LIST( AnyType Elem1, AnyType Elem2, ... )
  4647.  
  4648.    Constructs an object as a list of several other objects. Only a reference
  4649.  is made to the Elements, so modifying Elem1 after being included in the list
  4650.  will affect Elem1 in that list next time list is used!
  4651.  
  4652.    Each inclusion of an object in a list increases its internal used
  4653.  reference. The object is freed iff in used reference is zero.
  4654.    As a result, attempt to delete a variable (using FREE) which is referenced
  4655.  in a list removes the variable, but the object itself is freed only when the
  4656.  list is freed.
  4657. $
  4658.  
  4659. LOAD
  4660.  
  4661.  AnyType LOAD( StringType FileName )
  4662.  
  4663.    Loads an object from the given FileName. The object may be any object
  4664.  defined in the system, including lists, in which the structure is recovered
  4665.  and reconstructed as well (internal objects are inserted into the global
  4666.  system object list if they have names). If no file type is provided, ".dat"
  4667.  is assumed.
  4668.  
  4669.    This command can also be used to load binary files. Ascii regular data
  4670.  files are usually loaded in much more time then binary files due the 
  4671.  the parsing required. Binary data files can be loaded directly like ascii
  4672.  files in IRIT, but can only be inspected through IRIT tools such
  4673.  as dat2irit. A binary data file must have a ".bdt" (Binary DaTa) type in
  4674.  its name.
  4675.  
  4676.    Under unix, compressed files can be loaded if the given file name has
  4677.  a postfix of ".Z". The unix system's "zcat" will be invoked via a pipe
  4678.  for that purpose.
  4679. $
  4680.  
  4681. LOGFILE
  4682.  
  4683.  LOGFILE( NumericType Set )
  4684.  
  4685.  or
  4686.  
  4687.  LOGFILE( StringType FileName )
  4688.  
  4689.    If Set is non zero (see TRUE/FALSE and ON/OFF), then everything
  4690.  printed in the input window, will go to the log file specified in the
  4691.  IRIT.CFG configuration file. This file will be created the first time
  4692.  logfile is turned ON. If a string FileName is provided, it will
  4693.  be used as a log file name from now on. It also closes the current log
  4694.  file. A "LOGFILE( on );" must be issued after a log file name change.
  4695.  
  4696.  Example:
  4697.  
  4698.     LOGFILE( "Data1" );    
  4699.     LOGFILE( on );    
  4700.     printf( "Resolution = %lf\n", list( resolution ) );
  4701.     LOGFILE( off );    
  4702.  
  4703.  to print the current resolution level into file Data1.
  4704. $
  4705.  
  4706. MSLEEP
  4707.  
  4708.  MSLEEP( NumericType MilliSeconds )
  4709.  
  4710.  Causes the solid modeller to sleep for the prescribed time in milliseconds.
  4711.  
  4712.  Example:
  4713.  
  4714.  for ( i = 1, 1, sizeof( crvs ),
  4715.      c = nth( crvs, i ):
  4716.      color( c, yellow ):
  4717.      msleep(20):
  4718.      viewobj( c )
  4719.  );
  4720.  
  4721.  Displays an animation sequence and sleeps for 20 milliseconds between
  4722.  iterations.
  4723. $
  4724.  
  4725. NTH
  4726.  
  4727.  AnyType NTH( ListType ListObject, NumericType Index )
  4728.  
  4729.  Returns the Index (base count 1) element of the list ListObject.
  4730.  
  4731.  Example:
  4732.  
  4733.     Lst = list( a, list( b, c ), d );
  4734.     Lst2 = NTH( Lst, 2 );
  4735.  
  4736.  and now Lst2 is equal to 'list( b, c )'.
  4737. $
  4738.  
  4739. PAUSE
  4740.  
  4741.  PAUSE( NumericType Flush )
  4742.  
  4743.    Waits for a keystroke. Nice to have if a temporary stop in a middle of an
  4744.  included file (see INCLUDE) is required. If Flush is TRUE, then the input
  4745.  is first flushed to guarantee that the actual stop will occur.
  4746. $
  4747.  
  4748. PRINTF
  4749.  
  4750.  PRINTF( StringType CtrlStr, ListType Data )
  4751.  
  4752.  A formatted printing routine, following the concepts of the C programming
  4753.  language's printf routine. CtrlStr is a string object for which
  4754.  the following special '%' commands are supported:
  4755.  
  4756.     %d, %i, %u      Prints the numeric object as an integer or unsigned integer.
  4757.     %o, %x, %X      Prints the numeric object as an octal or hexadecimal integer.
  4758.     %e, %f, %g,     Prints the numeric object in several formats of
  4759.     %E, %F          floating point numbers.
  4760.     %s              Prints the string object as a string.
  4761.     %pe, %pf, %pg   Prints the three coordinates of the point object.
  4762.     %ve, %vf, %vg   Prints the three coordinates of the vector object.
  4763.     %Pe, %Pf, %Pg,  Prints the four coordinates of the plane object.
  4764.     %De, %Df, %Dg,  Prints the given object in IRIT's data file format.
  4765.  
  4766.  
  4767.  All the '%' commands can include any modifier that is valid in the C
  4768.  programming language printf routine, including l (long), prefix
  4769.  character(s), size, etc. The point, vector, plane, and object commands
  4770.  can also be modified in a similar way, to set the format of the
  4771.  numeric data printed.
  4772.  
  4773.  Also supported are the newline and tab using the backslash escape
  4774.  character:
  4775.  
  4776.  PRINTF("\\tThis is the char \"\\%\"\\n", nil());
  4777.  
  4778.  Backslashes should be escaped themselves as can be seen in the above example.
  4779.  Here are few more examples:
  4780.  
  4781.  PRINTF("this is a string \"%s\" and this is an integer %8d.\\n",
  4782.        list("STRING", 1987));
  4783.  PRINTF("this is a vector [%8.5lvf]\\n", list(vector(1,2,3)));
  4784.  IritState("DumpLevel", 9);
  4785.  PRINTF("this is a object %8.6lDf...\\n", list(axes));
  4786.  PRINTF("this is a object %10.8lDg...\\n", list(axes));
  4787.  
  4788.  This implementation of PRINTF is somewhat different than the C programming
  4789.  language's version, because the backslash always escapes the next
  4790.  character during the processing stage of IRIT's parser. That is, the string
  4791.  
  4792.         '\\tThis is the char \"\\%\"\\n'
  4793.  
  4794.  is actually parsed by the IRIT's parser into
  4795.  
  4796.         '\tThis is the char "\%"\n'
  4797.  
  4798.  because this is the way the IRIT parser processes strings. The latter
  4799.  string is the one that PRINTF actually see.
  4800. $
  4801.  
  4802. PROCEDURE
  4803.  
  4804.  ProcName = PROCEDURE(Prm1, Prm2, ... , PrmN):LclVal1:LclVar2: ... :LclVarM:
  4805.      ProcBody;
  4806.  
  4807.  A procedure is a function that does not return a value, and therefore the
  4808.  return variable (see FUNCTION) should not be used. A procedure is
  4809.  identical to a function in every other way. See FUNCTION for more.
  4810. $
  4811.  
  4812. RMATTR
  4813.  
  4814.  RMATTR( AnyType Object, StringType Name )
  4815.  
  4816.    Removes attribute named Name from object Object. This function
  4817.  will have no affect on Object if Object have no attribute named
  4818.  Name.
  4819.  
  4820.  See also ATTRIB.
  4821. $
  4822. SAVE
  4823.  
  4824.  SAVE( StringType FileName, AnyType Object )
  4825.  
  4826.    Saves the provided Object in the specified file name FileName.
  4827.  No extension type is needed (ignored if specified), and ".dat" is supplied
  4828.  by default. Object can be any object type, including list, in which
  4829.  structure is saved recursively. See also LOAD. If a display device is
  4830.  actively running at the time SAVE is invoked, its transformation matrix
  4831.  will be saved with the same name but with extension type of ".mat" instead
  4832.  of ".dat".
  4833.  
  4834.    This command can also be used to save binary files. Ascii regular data
  4835.  files are usually loaded in much more time then binary files due the 
  4836.  the parsing required. Binary data files can be loaded directly like ascii
  4837.  files in IRIT, but must be inspected through IRIT tools such
  4838.  as dat2irit. A binary data file must have a ".bdt" (Binary DaTa) type in
  4839.  its name.
  4840.  
  4841.    Under unix, files will be saved compressed if the given file name has
  4842.  a postfix of ".Z". The unix system's "compress" will be invoked via a pipe
  4843.  for that purpose.
  4844.  
  4845.    Example:
  4846.  
  4847.  SAVE( "Obj1.bdt.Z", Obj1 );
  4848.  
  4849.  Saves Obj1 in the file Obj1.bdt.Z as compressed binary file.
  4850. $
  4851.  
  4852. SNOC
  4853.  
  4854.  SNOC( AnyType Object, ListType ListObject )
  4855.  
  4856.    Similar to the lisp cons operator but puts the new Object in the
  4857.  end of the list ListObject instead of the beginning, in place.
  4858.  
  4859.  Example:
  4860.  
  4861.     Lst = list( axes );
  4862.     SNOC( Srf, Lst );
  4863.  
  4864.  and now Lst is equal to the list 'list( axes, Srf )'.
  4865. $
  4866.  
  4867. SYSTEM
  4868.  
  4869.  SYSTEM( StringType Command )
  4870.  
  4871.    Executes a system command Command. For example,
  4872.  
  4873.     SYSTEM( "ls -l" );
  4874. $
  4875.  
  4876. TIME
  4877.  
  4878.  TIME( NumericType Reset )
  4879.  
  4880.    Returns the time in seconds from the last time TIME was called with
  4881.  Reset TRUE. This time is CPU time if such support is available
  4882.  from the system (times function), and is real time otherwise (time
  4883.  function).
  4884.    The time is automatically reset at the beginning of the execution of this
  4885.  program.
  4886.  
  4887.  Example:
  4888.  
  4889.     Dummy = TIME( TRUE );
  4890.       .
  4891.       .
  4892.       .
  4893.     TIME( FALSE );
  4894.  
  4895.  prints the time in seconds between the above two time function calls.
  4896. $
  4897.  
  4898. VARLIST
  4899.  
  4900.  VARLIST()
  4901.  
  4902.    List all the currently defined objects in the system.
  4903. $
  4904.  
  4905. VECTOR
  4906.  
  4907.  VectorType VECTOR( NumericType X, NumericType Y, NumericType Z )
  4908.  
  4909.    Creates a vector type object, using the three provided NumericType scalars.
  4910. $
  4911.  
  4912. VIEW
  4913.  
  4914.  VIEW( GeometricTreeType Object, NumericType ClearWindow )
  4915.  
  4916.    Displays the (geometric) object(s) as given in Object.
  4917.  
  4918.    If ClearWindow is non-zero (see TRUE/FALSE and ON/OFF) the window is
  4919.  first cleared (before drawing the objects).
  4920.  
  4921.  Example:
  4922.  
  4923.     VIEW( Axes, FALSE );
  4924.  
  4925.  displays the predefined object Axes in the viewing window on top of
  4926.  what is drawn already.
  4927.  
  4928.  In version 4.0, this function is emulated (see iritinit.irt) using the
  4929.  VIEWOBJ function. In order to use the current viewing matrix, VIEW_MAT
  4930.  should be provided as an additional parameter. For example,
  4931.  
  4932.     VIEW( list( view_mat, Obj ), TRUE );
  4933.  
  4934.  However, since VIEW is a user defined function, the following will not
  4935.  use VIEW_MAT as one would expect:
  4936.  
  4937.     VIEW( view_mat, TRUE );
  4938.  
  4939.  because VIEW_MAT will be renamed inside the VIEW user defined function to
  4940.  a local (to the user defined function) variable.
  4941.  
  4942.  In iritinit.irt one can find several other useful VIEW related functions:
  4943.  
  4944.     VIEWCLEAR       Clears all data displayed on the display device.
  4945.     VIEWREMOVE      Removes the object specified by name from display.
  4946.     VIEWDISC        Disconnects from display device (which is still running)
  4947.                     while allowing IRIT to connect to a new device.
  4948.     VIEWEXIT        Forces the display device to exit.
  4949.     VIEWSAVE        Request sdisplay device to save transformation matrix.
  4950.     BEEP            An emulation of the BEEP command of versions prior to 4.0.
  4951.     VIEWSTATE       Allows to change the state of the display device.
  4952.  
  4953.  
  4954.    For the above VIEW related functions, only VIEWREMOVE, VIEWSAVE, and
  4955.  VIEWSTATE require a parameter, which is the file name and view state
  4956.  respectively. The view state can be one of several commands. See the
  4957.  display device section for more.
  4958.  
  4959.  Examples:
  4960.  
  4961.     VIEWCLEAR();
  4962.     VIEW( axes, off );
  4963.     VIEWSTATE( "LngrVecs" );
  4964.     VIEWSTATE( "DrawSolid" );
  4965.     VIEWSAVE( "matrix1" );
  4966.     VIEWREMOVE( "axes" );
  4967.     VIEWDISC();
  4968. $
  4969.  
  4970. VIEWOBJ
  4971.  
  4972.  VIEWOBJ( GeometricTreeType Object )
  4973.  
  4974.    Displays the (geometric) object(s) as given in Object.
  4975.  Object may be any GeometricType or a list of other
  4976.  GeometricTypes nested to an arbitrary level.
  4977.  
  4978.    Unlike IRIT versions prior to 4.0, VIEW_MAT is not explicitly used
  4979.  as the transformation matrix. In order to display with a VIEW_MAT view,
  4980.  VIEW_MAT should be listed as an argument (in that exact name) to
  4981.  VIEWOBJ. Same is true for the perspective matrix PRSP_MAT.
  4982.  
  4983.  Example:
  4984.  
  4985.     VIEWOBJ( list( view_mat, Axes ) );
  4986.  
  4987.  displays the predefined object Axes in the viewing window using the
  4988.  viewing matrix VIEW_MAT.
  4989. $
  4990.  
  4991. WHILE
  4992.  
  4993.  WHILE( NumericType Cond, AnyType Body )
  4994.  
  4995.    Executes the Body (see below), while the WHILE loop conditions
  4996.  Cond is evaluated into a non zero value. Cond is being
  4997.  evaluated before each iteration.
  4998.  
  4999.    The body may consist of any number of regular commands, separated by
  5000.  COLONs, including nesting loops to an arbitrary level.
  5001.  
  5002.  Example:
  5003.  
  5004.  deg = 0;
  5005.  rotstepx = rotx( 10 );
  5006.  WHILE ( deg < 360,
  5007.      deg = deg + 10:
  5008.      view_mat = rotstepx * view_mat:
  5009.      view( list( view_mat, axes ), ON )
  5010.  );
  5011.  
  5012.  Displays axes with a view direction that is rotated 10 degrees at a
  5013.  time around the X axis.
  5014. $
  5015.  
  5016.  
  5017. System variables
  5018. $
  5019.  
  5020.  System variables are predefined objects in the system. Any time IRIT is
  5021.  executed, these variable are automatically defined and set to values which
  5022.  are sometimes machine dependent. These are regular objects in any other
  5023.  sense, including the ability to delete or overwrite them. One can modify,
  5024.  delete, or introduce other objects using the IRITINIT.IRT file.
  5025.  
  5026. AXES
  5027.    Predefined polyline object (PolylineType) that describes the XYZ axes.
  5028. $
  5029.  
  5030. DRAWCTLPT
  5031.    Predefined Boolean variable (NumericType) that controls whether curves'
  5032.  control polygons and surfaces' control meshes are drawn (TRUE) or not
  5033.  (FALSE). Default is FALSE.
  5034. $
  5035.  
  5036. FLAT4PLY
  5037.    Predefined Boolean object (NumericType) that controls the way almost flat
  5038.  surface patches are converted to polygons: four polygons (TRUE) or only
  5039.  two polygons (FALSE). Default value is FALSE.
  5040. $
  5041.  
  5042. MACHINE
  5043.    Predefined numeric object (NumericType) holding the machine type as one of
  5044.  the following constants: MSDOS, SGI, HP, SUN, APOLLO, UNIX, IBMOS2, IBMNT,
  5045.  and AMIGA.
  5046. $
  5047.  
  5048. POLY_APPROX_OPT
  5049.    A variable controlling the algorithm to convert surfaces to polygons.
  5050.    This two digit number controls the method that is used to subdivide a
  5051.  surface into polygons.
  5052.    The first digit (units) can be one of:
  5053.  
  5054.     0    Uniform sampling in a fixed grid.
  5055.     1    An alternated U and V subdivision direction. Once U is
  5056.          subdivided and then V is subdivided.
  5057.     2    A min max subdivision direction. In other words, the
  5058.          direction that minimizes the maximal error is selected.
  5059.  
  5060.  
  5061.    The second digit (tenths) can be one of:
  5062.  
  5063.     0    A fixed sized regular grid. The side of the grid is set
  5064.          via the RESOLUTION variable.
  5065.     1    This mode is not for general use.
  5066.     2    Maximal distance between the surface and its polygonal
  5067.          approximation is bounded by bilinear surface fit.
  5068.          Maximal distance allowed is set via POLY_APPROX_TOL.
  5069.          Recommended choice for optimal polygonization.
  5070.     3    This mode is not for general use.
  5071.  
  5072. $
  5073.  
  5074. POLY_APPROX_UV
  5075.    A Boolean predefined variable. If TRUE, UV values of surface polygonal
  5076.  approximation are placed on attribute lists of vertices.
  5077. $
  5078.  
  5079. POLY_APPROX_TOL
  5080.    A numeric predefined tolerance control on the distance between the surface
  5081.  and its polygonal approximation in POLY_APPROX_OPT settings.
  5082. $
  5083.  
  5084. PRSP_MAT
  5085.    Predefined matrix object (MatrixType) to hold the perspective matrix
  5086.  used/set by VIEW and/or INTERACT commands. See also VIEW_MAT.
  5087. $
  5088.  
  5089. RESOLUTION
  5090.    Predefined numeric object (NumericType) that sets the accuracy of the
  5091.  polygonal primitive geometric objects and the approximation of curves and
  5092.  surfaces. Holds the number of divisions a circle is divided into (with
  5093.  minimum value of 4). If, for example, RESOLUTION is set to 6, then a
  5094.  generated CONE will effectively be a six-sided pyramid.
  5095.    Also controls the fineness of freeform curves and surfaces when they are
  5096.  approximated as piecewise linear polylines, and the fineness of freeform
  5097.  surfaces when they are approximated as polygons.
  5098. $
  5099.  
  5100. VIEW_MAT
  5101.    Predefined matrix object (MatrixType) to hold the viewing matrix used/set
  5102.  by VIEW and/or INTERACT commands. See also PRSP_MAT.
  5103. $
  5104.  
  5105. System constants
  5106.  
  5107.  The following constants are used by the various functions of the system to
  5108.  signal certain conditions. Internally, they are represented numerically,
  5109.  although, in general, their exact value is unimportant and may be changed
  5110.  in future versions. In the rare circumstance that  you need to know their
  5111.  values, simply type the constant as an expression.
  5112.  
  5113.  Example:
  5114.  
  5115.     MAGENTA;
  5116.  
  5117. $
  5118.  
  5119. AMIGA
  5120.  A constant designating an AMIGA system, in the MACHINE variable.
  5121. $
  5122.  
  5123. APOLLO
  5124.  A constant designating an APOLLO system, in the MACHINE variable.
  5125. $
  5126.  
  5127. BLACK
  5128.  A constant defining a BLACK color.
  5129. $
  5130.  
  5131. BLUE
  5132.  A constant defining a BLUE color.
  5133. $
  5134.  
  5135. COL
  5136.  A constant defining the COLumn or U direction of a surface or a
  5137.  trivariate mesh.
  5138. $
  5139.  
  5140. CTLPT_TYPE
  5141.  A constant defining an object of type control point.
  5142. $
  5143.  
  5144. CURVE_TYPE
  5145.  A constant defining an object of type curve.
  5146. $
  5147.  
  5148. CYAN
  5149.  A constant defining a CYAN color.
  5150. $
  5151.  
  5152. DEPTH
  5153.   A constant defining the DEPTH direction of a trivariate mesh.
  5154.  See TBEZIER, TBSPLINE.
  5155. $
  5156.  
  5157. E1
  5158.  A constant defining an E1 (X only coordinate) control point type.
  5159. $
  5160.  
  5161. E2
  5162.  A constant defining an E2 (X and Y coordinates) control point type.
  5163. $
  5164.  
  5165. E3
  5166.  A constant defining an E3 (X, Y and Z coordinates) control point type.
  5167. $
  5168.  
  5169. E4
  5170.  A constant defining an E4 control point type.
  5171. $
  5172.  
  5173. E5
  5174.  A constant defining an E5 control point type.
  5175. $
  5176.  
  5177. FALSE
  5178.  A zero constant. May be used as Boolean operand.
  5179. $
  5180.  
  5181. GREEN
  5182.  A constant defining a GREEN color.
  5183. $
  5184.  
  5185. HP
  5186.  A constant designating an HP system, in the MACHINE variable.
  5187. $
  5188.  
  5189. IBMOS
  5190.  A constant designating an IBM system running under OS2, in the MACHINE
  5191.  variable.
  5192. $
  5193.  
  5194. IBMNT
  5195.  A constant designating an IBM system running under Windows NT, in the MACHINE
  5196.  variable.
  5197. $
  5198.  
  5199. KV_FLOAT
  5200.  A constant defining a floating end condition uniformly spaced knot vector.
  5201. $
  5202.  
  5203. KV_OPEN
  5204.  A constant defining an open end condition uniformly spaced knot vector.
  5205. $
  5206.  
  5207. KV_PERIODIC
  5208.  A constant defining a periodic end condition with uniformly spaced knot
  5209.  vector.
  5210. $
  5211.  
  5212. LIST_TYPE
  5213.  A constant defining an object of type list.
  5214. $
  5215.  
  5216. MAGENTA
  5217.  A constant defining a MAGENTA color.
  5218. $
  5219.  
  5220. MATRIX_TYPE
  5221.  A constant defining an object of type matrix.
  5222. $
  5223.  
  5224. MSDOS
  5225.  A constant designating an MSDOS system, in the MACHINE variable.
  5226. $
  5227.  
  5228. NUMERIC_TYPE
  5229.  A constant defining an object of type numeric.
  5230. $
  5231.  
  5232. OFF
  5233.  Synonym of FALSE.
  5234. $
  5235.  
  5236. ON
  5237.  Synonym for TRUE.
  5238. $
  5239.  
  5240. P2
  5241.  A constant defining a P1 (W and WX coordinates, in that order) rational
  5242.  control point type.
  5243. $
  5244.  
  5245. P2
  5246.  A constant defining a P2 (W, WX, and WY coordinates, in that order) rational
  5247.  control point type.
  5248. $
  5249.  
  5250. P3
  5251.  A constant defining a P3 (W, WX, WY, and WZ coordinates, in that order)
  5252.  rational control point type.
  5253. $
  5254.  
  5255. P4
  5256.  A constant defining a P4 rational control
  5257.  point type.
  5258. $
  5259.  
  5260. P5
  5261.  A constant defining a P5 rational control
  5262.  point type.
  5263. $
  5264.  
  5265. PARAM_CENTRIP
  5266.  A constant defining a centripetal length parametrization.
  5267. $
  5268.  
  5269. PARAM_CHORD
  5270.  A constant defining a chord length parametrization.
  5271. $
  5272.  
  5273. PARAM_UNIFORM
  5274.  A constant defining an uniform parametrization.
  5275. $
  5276.  
  5277. PI
  5278.  The constant of 3.141592...
  5279. $
  5280.  
  5281. PLANE_TYPE
  5282.  A constant defining an object of type plane.
  5283. $
  5284.  
  5285. POINT_TYPE
  5286.  A constant defining an object of type point.
  5287. $
  5288.  
  5289. POLY_TYPE
  5290.  A constant defining an object of type poly.
  5291. $
  5292.  
  5293. RED
  5294.  A constant defining a RED color.
  5295. $
  5296.  
  5297. ROW
  5298.   A constant defining the ROW or V direction of a surface or a trivariate mesh.
  5299. $
  5300.  
  5301. SGI
  5302.  A constant designating an SGI system, in the MACHINE variable.
  5303. $
  5304.  
  5305. STRING_TYPE
  5306.  A constant defining an object of type string.
  5307. $
  5308.  
  5309. SURFACE_TYPE
  5310.  A constant defining an object of type surface.
  5311. $
  5312.  
  5313. SUN
  5314.  A constant designating a SUN system, in the MACHINE variable.
  5315. $
  5316.  
  5317. TRIMSRF_TYPE
  5318.  A constant defining an object of type trimmed surface.
  5319. $
  5320.  
  5321. TRIVAR_TYPE
  5322.  A constant defining an object of type trivariate function.
  5323. $
  5324.  
  5325. TRUE
  5326.  A non zero constant. May be used as Boolean operand.
  5327. $
  5328.  
  5329. UNDEF_TYPE
  5330.  A constant defining an object of no type (yet).
  5331. $
  5332.  
  5333. UNIX
  5334.  A constant designating a generic UNIX system, in the MACHINE variable.
  5335. $
  5336.  
  5337. VECTOR_TYPE
  5338.  A constant defining an object of type vector.
  5339. $
  5340.  
  5341. WHITE
  5342.  A constant defining a WHITE color.
  5343. $
  5344.  
  5345. YELLOW
  5346.  A constant defining a YELLOW color.
  5347. $
  5348.  
  5349.  
  5350. Animation
  5351.  
  5352.  The animation tool adds the capability of animating objects using
  5353.  forward kinematics, exploiting animation curves.  Each object has
  5354.  different attributes, that prescribe its motion, scale, and visibility
  5355.  as a function of time. Every attribute has a name, which designates
  5356.  it's role. For instance an attribute animation curve named MOV_X
  5357.  describes a translation motion along the X axis.
  5358.  
  5359.  
  5360.  Let OBJ be an object in IRIT to animate.
  5361.  
  5362.  Animation curves are either scalar (E1/P1) curves or three dimensional
  5363.  (E3/P3) curves with one of the following names:
  5364.  
  5365.      MOV_X, MOV_Y, MOV_Z            Translation along one axis 
  5366.      MOV_XYZ                        Arbitrary translation along all three axes
  5367.      ROT_X, ROT_Y, ROT_Z            Rotating around a single axis (degrees)
  5368.      SCL_X, SCL_Y, SCL_Z            Scale along a single axis  
  5369.      SCL                            Global scale               
  5370.      VISIBLE                        Visibility                 
  5371.  
  5372.  
  5373.  The visibility curve is a scalar curve that enables the display of
  5374.  the object if the visibility curve is positive at time t and disables
  5375.  the display (hide) the object if the visibility curve is negative at
  5376.  time t.
  5377.  
  5378.  The animation curves are all attached as an attribute named "animation"
  5379.  to the object OBJ.
  5380.  
  5381.  Example:
  5382.     mov_x = cbezier( ctlpt( E1, 0.0 ),
  5383.                      ctlpt( E1, 1.0 ) );
  5384.     scl   = cbezier( ctlpt( E1, 1.0 ),
  5385.                      ctlpt( E1, 0.1 ) );
  5386.     rot_y = cbezier( ctlpt( E1, 0.0 ),
  5387.                      ctlpt( E1, 0.0 ) );
  5388.                      ctlpt( E1, 360.0 ) );
  5389.     attrib(OBJ, "animation", list( mov_x, scl, rot_y ) );
  5390.  
  5391.  To animate OBJ between time zero and one (Bezier curves are always
  5392.  between zero and one), by moving it a unit size in the X direction,
  5393.  scaling it to %10 of its original size and rotating it at increasing
  5394.  angular speed from zero to 360 degrees.
  5395.  
  5396.  OBJ can now be save into a file or displayed via one of the regular
  5397.  viewing commands in IRIT (i.e. VIEWOBJ).
  5398.  
  5399.  Animation is not always between zero and one. To that end one can
  5400.  apply the CREPARAM function to modify the parametric domain of the
  5401.  animation curve. The convention is that if the time is below the
  5402.  starting value of the parametric domain, the starting value of the
  5403.  curve is used.  Similarly if the time is beyond the end of the
  5404.  parameter domain of the animation curve, the end value of the
  5405.  animation curve is used.
  5406.  
  5407.  Example:
  5408.     CREPARAM( mov_x, 3.0, 5.0 );
  5409.  
  5410.  to set the time of the motion in the x axis to be from t = 3 to
  5411.  t = 5.  for t < 3, mov_x(3) is used, and for t > 5, mov_x(5) is
  5412.  employed.
  5413.  
  5414.  the animation curves are regular objects in the IRIT system. Hence,
  5415.  only one object named mov_x or scl can exist at one time. If you
  5416.  create a new object named mov_x, the old one is overwritten! To
  5417.  preserve old animation curves you can detach the old ones by executing
  5418.  'free(mov_x)' that removes the object named mov_x from IRIT's object
  5419.  list but not from its previous used locations within other list
  5420.  objects, if any. For example:
  5421.  
  5422.     mov_x = cbezier( ctlpt( E1, 0.0 ),
  5423.                      ctlpt( E1, 1.0 ) );
  5424.     attrib(obj1, "animation", list( mov_x ) );
  5425.     free(mov_x);
  5426.  
  5427.     mov_x = cbezier( ctlpt( E1, 2.0 ),
  5428.                      ctlpt( E1, 3.0 ) );
  5429.     attrib(obj2, "animation", list( mov_x ) );
  5430.     free(mov_x);
  5431.  
  5432.  
  5433.   a = box( vector( 0, 0, 0 ), 1, 1, 1 );
  5434.   b = box( vector( 0, 0, 0 ), 1, 1, 1 );
  5435.   c = box( vector( 0, 0, 0 ), 1, 1, 1 );
  5436.   d = sphere( vector( 0, 0, 0), 0.7 );
  5437.   
  5438.   pt0   =  ctlpt( e1,  0.0 );
  5439.   pt1   =  ctlpt( e1,  1.0 );
  5440.   pt2   =  ctlpt( e1,  2.0 );
  5441.   pt6   =  ctlpt( e1,  6.0 );
  5442.   pt360 =  ctlpt( e1,  360.0 );
  5443.   
  5444.   pt10 = ctlpt( e1, -4.0 );
  5445.   pt11 = ctlpt( e1,  1.0 );
  5446.   pt12 = ctlpt( e1,  4.0 );
  5447.   pt13 = ctlpt( e1, -1.0 );
  5448.   
  5449.   visible = creparam( cbezier( list( pt10,  pt11 ) ), 0.0, 5.0 );
  5450.   mov_x   = creparam( cbezier( list( pt0, pt6, pt2 ) ), 0.0, 1.2 );
  5451.   mov_y   = mov_x;
  5452.   mov_z   = mov_x;
  5453.   rot_x   = creparam( cbspline( 2,
  5454.                                 list( pt0, pt360, pt0 ),
  5455.                                 list( KV_OPEN ) ),
  5456.                       1.2, 2.5 ); 
  5457.   rot_y   = rot_x;
  5458.   rot_z   = rot_x;
  5459.   scl     = creparam( cbezier( list( pt1, pt2, pt1, pt2, pt1 ) ),
  5460.                       2.5, 4.0 );
  5461.   scl_x   = scl;
  5462.   scl_y   = scl;
  5463.   scl_z   = scl;
  5464.   mov_xyz = creparam( circle( vector( 0, 0, 0 ), 2.0 ), 4.0, 5.0 );
  5465.   
  5466.   attrib( d, "animation", list( mov_xyz, visible ) );
  5467.   free( visible );
  5468.   
  5469.   visible = creparam( cbezier( list( pt12,  pt13 ) ), 0.0, 5.0 );
  5470.   
  5471.   attrib( a, "animation", list( rot_x, mov_x, scl, scl_x, visible ) );
  5472.   attrib( b, "animation", list( rot_y, mov_y, scl, scl_y, visible ) );
  5473.   attrib( c, "animation", list( rot_z, mov_z, scl, scl_z, visible ) );
  5474.   
  5475.   color( a, red );
  5476.   color( b, green );
  5477.   color( c, blue );
  5478.   color( d, cyan );
  5479.   
  5480.   demo = list( a, b, c, d );
  5481.   
  5482.   interact( demo );
  5483.   viewanim( 0, 5, 0.01 );
  5484.  
  5485.  In this example, we create four objects, three cubes and one sphere.
  5486.  Animation curves to translate the three cubes along the three axes for
  5487.  the time period of t = 0 to t = 1.2 are created. Rotation curves to
  5488.  rotate the three cubes along the three axes are then created for time
  5489.  period of t = 1.2 to t = 2.5. Finally, for the time period of t = 2.5
  5490.  to t = 4.0. the cubes are (not only) unifomly scaled. For the time
  5491.  period of t = 4 to t = 5, the cubes become invisible and the sphere,
  5492.  that becomes visible, is rotated along a circle of radius 2.
  5493.  
  5494. $
  5495.  
  5496.  
  5497. Display devices
  5498.  
  5499.  The following display device drivers are available,
  5500.  
  5501.     Device Name            Invocation             Environment        
  5502.                                                                      
  5503.     xgldrvs                xgldrvs -s-            SGI 4D GL regular driver.
  5504.     xogldrvs               xogldrvs -s-           SGI 4D Open GL/Motif driver.
  5505.     xgladap                xgladap -s-            SGI 4D GL adaptive isocurve
  5506.                                                   experimental driver.
  5507.     x11drvs                x11drvs -s-            X11 driver.        
  5508.     xmtdrvs                xmtdrvs -s-            X11 Motif driver.  
  5509.     xglmdrvs               xglmdrvs -s-           SGI 4D GL and X11/Motif driver.
  5510.     wntdrvs                wntdrvs -s-            IBM PC Windows NT driver.
  5511.     wntgdrvs               wntgdrvs -s-           IBM PC Windows NT Open GL driver.
  5512.     os2drvs                os2drvs -s-            IBM PC OS2 2.x driver.
  5513.     amidrvs                amidrvs -s-            AmigaDOS 2.04+ driver.
  5514.     nuldrvs                nuldrvs -s- [-d] [-D]   A device to print the
  5515.                                                   object stream to stdout.
  5516.  
  5517.  
  5518.  All display devices are clients communicating with the server (IRIT)
  5519.  using IPC (inter process communication). On Unix and Window NT sockets are
  5520.  used. A Windows NT client can talk to a server (IRIT) on a unix host if
  5521.  hooked to the same netwrok. On OS2 pipes are used, and both the client and
  5522.  server must run on the same machine. On AmigaDOS exec messages are used,
  5523.  and both the client and server must run on the same machine.
  5524.  
  5525.    While all display devices support object(s) transformations via a
  5526.  transformation control window, many of the display devices allow one
  5527.  to click and drag on the viewing window to rotate (Left Button) and
  5528.  to translate (Right Button).  This mode exploits the two degrees of
  5529.  freedom of the mouse to provide intuitive dual axis rotation and
  5530.  translation.
  5531.  
  5532.    The server (IRIT) will automatically start a client display device
  5533.  if the IRIT_DISPLAY environment variable is set to the name and options of
  5534.  the display device to run. For example:
  5535.  
  5536.     setenv IRIT_DISPLAY xgldrvs -s-
  5537.  
  5538.    The display device must be in a directory that is in the path
  5539.  environment variable. Most display devices require the '-s-' flags to run
  5540.  in a non-standalone mode, or a client-server mode. Most drivers can also
  5541.  be used to display data in a standalone mode (i.e., no server). For
  5542.  example:
  5543.  
  5544.     xgldrvs -s solid1.dat irit.mat
  5545.  
  5546.     Effectively, all the display devices are also data display programs
  5547.  (poly3d, which was the display program prior to version 4.0, is retired
  5548.  in 4.0). Therefore some functionality is not always as expected. For
  5549.  example, the quit button will always force the display device to quit,
  5550.  even if poped up from IRIT, but will not cause IRIT to
  5551.  quit as might logically expected. In fact, the next time IRIT will
  5552.  try to communicate with the display device, it will find the broken
  5553.  connection and will start up a new display device.
  5554.  
  5555.     Most display devices recognize attributes found on objects. The following
  5556.  attributes are usually recognized (depending on the device capability.):
  5557.  
  5558.   COLOR: Selects the drawn color of the object to be one of the 8/16
  5559.         predefined colors in the IRIT system: white, red, green, blue,
  5560.         yellow, cyan, magenta, black.
  5561.   RGB: Overwrites (if supported) the COLOR attribute (if given) and
  5562.         sets the color of the object to the exact prescribed RGB set.
  5563.   DWIDTH: Sets the width in pixels of the drawn object, when drawn as
  5564.         a wireframe.
  5565.  
  5566.     All display devices recognize all the command line flags and all the
  5567.  configuration options in a configuration file, as described below. The display
  5568.  devices will make attemps to honor the requests, to the best of their ability.
  5569.     For example, only xgldrvs can render shaded models, and so only it will
  5570.  honor a DrawSolid configuration options.
  5571.  
  5572.  
  5573.  ???drvs [-s] [-u] [-n] [-N] [-i] [-c] [-C] [-m] [-a] [-g x1,x2,y1,y2]
  5574.          [-G x1,x2,y1,y2] [-I #IsoLines] [-F PolygonOpti FineNess] 
  5575.          [-f PolylineOpti SampPerCrv] [-l LineWidth] [-r] [-A Shader] [-B]
  5576.          [-2] [-d] [-D] [-L NormalLen] [-4] [-b BackGround] [-S LgtSrcPos]
  5577.          [-Z ZMin ZMax] [-M] [-P] [-x ExecAnim] [-z] DFiles
  5578.  
  5579.   -s: Runs the driver in a Standalone mode. Otherwise, the driver will
  5580.         attempt to communicate with the IRIT server.
  5581.   -u: Forces a Unit matrix. That is, input data are not
  5582.         transformed at all.
  5583.   -n: Draws normals of vertices.
  5584.   -N: Draws normals of polygons.
  5585.   -i: Draws internal edges (created by IRIT) - default is not to
  5586.         display them, and this option will force displaying them as well.
  5587.   -c: Sets depth cueing on. Drawings that are closer to the viewer will
  5588.         be drawn in more intense color.
  5589.   -C: Cache the piecewise linear geometry so curves and surface can
  5590.         be redisplay faster. Purging it will free memory, on the other hand.
  5591.   -m: Provides some more information on the data file(s) parsed.
  5592.   -a: Sets the support of antialiased lines.
  5593.   -g x1,x2,y1,y2: Prescribes the position and location of the
  5594.         transformation window by prescribing the domain of the window in
  5595.         screen space pixels.
  5596.   -G x1,x2,y1,y2: Prescribes the position and location of the
  5597.         viewing window by prescribing the domain of the window in
  5598.         screen space pixels.
  5599.   -I #IsoLines: Specifies number of isolines per surface, per direction.
  5600.         A specification of zero isolines is possible only on the command line
  5601.         and it denotes the obvious.
  5602.   -F PolyOpti FineNess: Controls the method used to approximate surfaces
  5603.         into polygons. See the variable POLY_APPROX_OPT for the meaning of
  5604.         FineNess. See also -4.
  5605.   -f PolyOpti SampPerCrv: Controls the method used to approximate curves
  5606.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  5607.         Otherwise, an adaptive subdivision that optimizes the samples is
  5608.         employed.
  5609.   -l LineWidth: Sets the linewidth, in pixels. Default is one pixel wide.
  5610.   -r: Rendered mode. Draws object as solid.
  5611.   -A Shader: Shader can be one of 1 (Flat), 2 (Gouraud), or 3 (Phong).
  5612.   -B: Back face culling of polygons.
  5613.   -2: Double buffering. Prevents screen flicker on the expense of
  5614.         possibly less colors.
  5615.   -d: Debug objects. Prints to stderr all objects read from communcation
  5616.         port with the server IRIT. 
  5617.   -D: Debug input. Prints to stderr all characters read from communcation
  5618.         port with the server IRIT. Lowest level of communication.
  5619.   -L NormalLen: Sets the length of the drawn normals in thousandths of
  5620.         a unit.
  5621.   -4: Forces four polygons per almost flat region in the surface to
  5622.         polygon conversion. Otherwise two polygons only.
  5623.   -b BackGround: Sets the background color as three RGB integers in the
  5624.         range of 0 to 255.
  5625.   -S LgtSrcPos: Sets the lighting via the light source position.
  5626.   -Z ZMin ZMax: Sets the near and far Z clipping planes.
  5627.   -M: Draw control mesh/polygon of curves and surfaces, as well.
  5628.   -x ExecAnim: Command to execute as a subprocess every iteration of
  5629.         display of an animation sequence. This command can for example save
  5630.         the display into an image file, saving the animation sequence.
  5631.         One parameter is passed, which is an running index starting from one.
  5632.   -P: Draws curves and surfaces (surfaces are drawn using a set of
  5633.         isocurves, see -I, or polygons, see -f).
  5634.   -z: Prints version number and current defaults.
  5635.  
  5636. Configuration Options
  5637.  
  5638.  The configuration file is read before the command line options are
  5639.  processed. Therefore, all options in this section can be overriden
  5640.  by the appropriate command line option, if any.
  5641.  
  5642.   TransPrefPos: Preferred location (Xmin, YMin, Xmax, Ymax) of the
  5643.         transformation window.
  5644.   ViewPrefPos: Preferred location (Xmin, YMin, Xmax, Ymax) of the
  5645.         viewing window.
  5646.   BackGround: Background color. Same as '-b'.
  5647.   Internal: Draws internal edges. Same as '-i'.
  5648.   LightSrcPos: Sets the location of the (first) light source as a rational
  5649.         four coefficient location. W of zero sets the light source at infinity.
  5650.   ExecAnim: Executes animation. Same as '-x'.
  5651.   DrawVNormal: Draws normals of vertices. Same as '-n'.
  5652.   DrawPNormal: Draws normals of polygons. Same as '-n'.
  5653.   MoreVerbose: Provides some more information on the data file(s)
  5654.         parsed. Same as '-m'.
  5655.   UnitMatrix: Forces a Unit matrix. That is, input data are not
  5656.         transformed at all. Same as '-u'.
  5657.   DrawSolid: Requests a shaded surface rendering, as opposed to isocurve
  5658.         surface representation.
  5659.   BFaceCull: Requests the removal of back facing polygons, for better
  5660.         visibility.
  5661.   DoubleBuffer: Requests drawing using a double buffer, if any.
  5662.   DebugObjects: Debug objects. Prints to stderr all objects read
  5663.         from the communcation port with the server IRIT. Same as '-d'.
  5664.   DebugEchoInput: Debug input. Prints to stderr all characters read
  5665.         from the communcation port with the server IRIT. Lowest level of
  5666.         communications.
  5667.   DepthCue: Set depth cueing on. Drawings that are closer to the
  5668.         viewer will be drawn in more intense color. Same as '-c'.
  5669.   CacheGeom: Normally piecewise linear approximation of freefroms is
  5670.         cached. By setting this option to FALSE, no such auxiliary data is
  5671.         being saved, reducing the memory overhead. Same as '-C'.
  5672.   FourPerFlat: Forces four polygons per almost flat region in the
  5673.         surface to polygon conversion. Otherwise two polygons only. Same as
  5674.         '-4'.
  5675.   AntiAlias: Request the drawing of anti aliased lines.
  5676.   DrawSurfaceMesh: Draws control mesh/polygon of curves and surfaces,
  5677.         as well. Same as '-M'.
  5678.   DrawSurfacePoly: Draws curves and surfaces (surfaces are drawn using
  5679.         a set of isocurves, see -I, or polygons, see -f). Same as '-P'.
  5680.   StandAlone: Runs the driver in a Stand alone mode. Otherwise, the
  5681.         driver will attempt to communicate with the IRIT server. Same
  5682.         as '-s'.
  5683.   NumOfIsolines:  Specifies number of isolines per surface, per
  5684.         direction. Same as '-I'.
  5685.   SamplesPerCurve: Specifies the samples per (iso)curve. See '-f'.
  5686.   LineWidth: Sets the linewidth, in pixels. Default is one pixel
  5687.        wide. Same as '-l'
  5688.   AdapIsoDir: Selects the direction of the adaptive isoline
  5689.         rendering.
  5690.   PolygonOpti: Controls the method used to subdivide a surface into
  5691.         polygons that approximate it. Same as '-F'.
  5692.   PolylineOpti: Controls the method used to subdivide a curve into
  5693.         polylines that approximate it. Same as '-f'.
  5694.   ShadingModel: One of 1 (Flat), 2 (Gouraud), or 3 (Phong). Same as
  5695.         '-A'.
  5696.   TransMode: Selects between object space transformations and screen
  5697.         space transformation.
  5698.   ViewMode: Selects between perspective and orthographic views.
  5699.   NormalLength: Sets the length of the drawn normals in thousandths of
  5700.         a unit. Same as '-L'.
  5701.   ZClipMin: Sets the minimal clipping plane in Z. Same as '-Z'.
  5702.   ZClipMax: Sets the maximal clipping plane in Z. Same as '-Z'.
  5703.   FineNess: Controls the fineness of the surface to polygon subdivision.
  5704.         See '-F'.
  5705.  
  5706.  
  5707.    Commands that affect the status of the display device can also be sent
  5708.  via the communication port with the IRIT server. The following commands
  5709.  are recognized as string objects with object name of "COMMAND_":
  5710.  
  5711.     BEEP                 Makes some sound. 
  5712.     CLEAR                Clears the display area. All objects are deleted.
  5713.     DCLEAR               Delayed clear. Same as CLEAR but delayed until next
  5714.                          object is sent from the server. Useful for animation.
  5715.     DISCONNECT           Closes connection with the server, but does not quit.
  5716.     EXIT                 Closes connection with the server and quits.
  5717.     GETOBJ NAME          Requests the object named NAME that is returned
  5718.                          in the output channel to the server.
  5719.     MSAVE NAME           Saves the transformation matrix file by the name
  5720.    
  5721.                      NAME.             
  5722.     REMOVE NAME          Request the removal of object named NAME from
  5723.    
  5724.                      display.          
  5725.     ANIMATE TMin TMax Dt  Animates current scene from TMin to TMax in Dt
  5726.    
  5727.                      steps.            
  5728.     STATE COMMAND        Changes the state of the display device. See below.
  5729.  
  5730.    The following commands are valid for the STATE COMMAND above,
  5731.  
  5732.     MoreSense:        More sensitive mouse control.
  5733.     LessSense:        Less sensitive mouse control.
  5734.     ScrnObject:       Toggle screen/object transformation mode.
  5735.     PerspOrtho:       Toggles perspective/orthographic trans. mode.
  5736.     DepthCue:         Toggles depth cueing drawing.
  5737.     DrawSolid:        Toggles isocurve/shaded solid drawing.
  5738.     ShadingMdl:       Toggles shading model for solid solid drawing.
  5739.     BFaceCull:        Cull back facing polygons.
  5740.     DblBuffer:        Toggles single/double buffer mode.
  5741.     AntiAlias:        Toggles anti aliased lines.
  5742.     DrawIntrnl:       Toggles drawing of internal lines.
  5743.     DrawVNrml:        Toggles drawing of normals of vertices.
  5744.     DrawPNrml:        Toggles drawing of normals of polygons.
  5745.     DSrfMesh:         Toggles drawing of control meshes/polygons.
  5746.     DSrfPoly:         Toggles drawing of curves/surfaces.
  5747.     4PerFlat:         Toggles 2/4 polygons per flat surface regions.
  5748.     MoreIso:          Doubles the number of isolines in a surface.
  5749.     LessIso:          Halves the number of isolines in a surface.
  5750.     FinrAprx:         Doubles the number of samples per curve.
  5751.     CrsrAprx:         Halves the number of samples per curve.
  5752.     LngrVecs:         Doubles the length of displayed normal vectors.
  5753.     ShrtrVecs:        Halves the length of displayed normal vectors.
  5754.     WiderLns:         Doubles the width of the drawn lines.
  5755.     NarrwLns:         Halves the width of the drawn lines.
  5756.     WiderPts:         Doubles the width of the cross of drawn points.
  5757.     NarrwPts:         Halves the width of the cross of drawn points.
  5758.     FinrAdapIso:      Doubles the number of adaptive isocurves.
  5759.     CrsrAdapIso:      Halves the number of adaptive isocurves.
  5760.     FinerRld:         Doubles number of ruled surfaces in adaptive isocurves.
  5761.     CrsrRld:          Halves number of ruled surfaces in adaptive isocurves.
  5762.     RuledSrfApx:      Toggles ruled surface approx. in adaptive isocurves.
  5763.     AdapIsoDir:       Toggles the row/col direction of adaptive isocurves.
  5764.     Front:            Selects a front view.
  5765.     Side:             Selects a side view.
  5766.     Top:              Selects a top view.
  5767.     Isometry:         Selects an isometric view.
  5768.     Clear:            Clears the viewing area.
  5769.  
  5770.  Obviously not all state options are valid for all drivers.
  5771.    The IRIT server defines in iritinit.irt several user-defined
  5772.  functions that exercise some of the above state commands, such as
  5773.  VIEWSTATE and VIEWSAVE.
  5774.  
  5775.    In addition to state modification via communication with the IRIT
  5776.  server, modes can be interactively modified on most of the display devices
  5777.  using a pop-up menu that is activated using the right button in the
  5778.  transformation window}.
  5779.    This pop up menu is somewhat different in different drivers, but its
  5780.  entries closely follow the entries of the above state command table.
  5781.  
  5782.  
  5783.    All the display drivers are now able to animate objects with animation
  5784.  curves' attributes on them. For more on the way animation curves can be
  5785.  created see the Animation Section of this manual
  5786.  
  5787.    Once a scene with animation curves' attributes is being loaded into
  5788.  a display device, one can enter "animation" mode using the "Animation"
  5789.  button available in all display devices. The user is then prompt (either
  5790.  graphically or in a textual based interface) for the starting time,
  5791.  termination time and step size of the animation. The parameter space of
  5792.  the animation curve is serving as the time domain. The default staring
  5793.  and terminating times are set as the minimal and maximal parametric
  5794.  domain values of all animation curves. An object at time t below the
  5795.  minimal parametric value will be placed at the starting value of the
  5796.  animation curve. Similarly, an object at time t above the
  5797.  maximal parametric value will be placed at the termination value of the
  5798.  animation curve. The user can also set a bouncing back and forth mode,
  5799.  the number of repetitions, and if desired, request the saving of all
  5800.  the different scenes in the animation as seperate files so a high quality
  5801.  animation can be created.
  5802.  
  5803.  
  5804.    The x11drvs supports the following X Defaults (searched at ~/.Xdefaults):
  5805.         #ifndef COLOR
  5806.         irit*MaxColors:                    1
  5807.         irit*Trans*BackGround:             Black
  5808.         irit*Trans*BorderColor:            White
  5809.         irit*Trans*TextColor:              White
  5810.         irit*Trans*SubWin*BackGround:      Black
  5811.         irit*Trans*SubWin*BorderColor:     White
  5812.         irit*Trans*CursorColor:            White
  5813.         irit*View*BackGround:              Black
  5814.         irit*View*BorderColor:             White
  5815.         irit*View*CursorColor:             White
  5816.         #else
  5817.         irit*MaxColors:                    15
  5818.         irit*Trans*BackGround:             NavyBlue
  5819.         irit*Trans*BorderColor:            Red
  5820.         irit*Trans*TextColor:              Yellow
  5821.         irit*Trans*SubWin*BackGround:      DarkGreen
  5822.         irit*Trans*SubWin*BorderColor:     Magenta
  5823.         irit*Trans*CursorColor:            Green
  5824.         irit*View*BackGround:              NavyBlue
  5825.         irit*View*BorderColor:             Red
  5826.         irit*View*CursorColor:             Red
  5827.         #endif
  5828.         irit*Trans*BorderWidth:            3
  5829.         irit*Trans*Geometry:               =150x500+510+0
  5830.         irit*View*BorderWidth:             3
  5831.         irit*View*Geometry:                =500x500+0+0
  5832.  The Motif-based display drivers contain three types of gadgets which can be
  5833.  operated in the following manner. Scales: can be dragged or clicked outside
  5834.  button for single (mouse's middle button) or continuous (mouse's left
  5835.  button) action. Pushbuttons: activated by clicking the mouse's left button.
  5836.  The control panel: allowes rotation, translation of the objects in three
  5837.  axes, determine perspective ratio, viewing object from top, side, front or
  5838.  isometrically, determining scale factor and clipping settings, and operate
  5839.  the matrix stack. 
  5840.  
  5841.    The environment window toggles between screen or object transformation,
  5842.  depth cue on or off, orthographic or perspective projection, wireframe or
  5843.  solid display, single or double buffering, showing or hiding normals,
  5844.  including or excluding the surface;s mesh and curve;s control polygon,
  5845.  surface drawing using isolines or polygons, and four or two polygons per
  5846.  flat patch. Same display devices allow for the inclusion or exclusion of
  5847.  internal edges, and enable or disable of antialiased lines.
  5848.  Scales in the X11/Motif based devices set normals length, lines width,
  5849.  control sensitivity, the number of islolines and samples, etc.
  5850.    The locations of windows as set via [-g] and [-G] and/or via the
  5851.  configuration file overwrites in x11drvs the Geometry X11 defaults.
  5852.  To use the Geometry X11 default use '-G " "' and '-g " "' or set the
  5853.  string to empty size in the configuration file.
  5854.    In os2drvs, only -G is used to specify the dimensions of the parent window
  5855.  that holds both the viewing and the transformation window.
  5856.    In os2drvs, the following key strokes are available as short cuts:
  5857.  
  5858.     Key        Function
  5859.     ^x         Quit    
  5860.     ^s         Save    
  5861.     ^f         Front View
  5862.     ^d         Side View
  5863.     ^t         Top View
  5864.     ^i         Isometric VIew
  5865.     ^p         Perspetive/Orthographic
  5866.     ^n         View Internal Edges
  5867.     ^v         View Vertices' Normals
  5868.     ^g         View Polygons' Normals
  5869.     ^b         Backface Culling
  5870.     ^c         Depth Cue
  5871.     ^m         View Control Mesh/Poly
  5872.  
  5873.  
  5874. $
  5875.  
  5876.  
  5877. Utilities - General Usage
  5878.  
  5879.    The IRIT solid modeler is accompanied by quite a few utilities. They
  5880.  can be subdivided into two major groups. The first includes auxiliary tools
  5881.  such as illustrt and poly3d-h. The second includes filters such as irit2ray
  5882.  and irit2ps.
  5883.  
  5884.    All these tools operate on input files, and most of the time produce
  5885.  data files. In all utilities that read files, the dash ('-') can be used
  5886.  to read stdin.
  5887.  
  5888.  Example:
  5889.  
  5890.  poly3d-h solid1.dat | irit2ps - > solid1.ps
  5891.  
  5892.    All the utilities have command line options. If an option is set by a '-x'
  5893.  then '-x-' resets the option. The command line options overwrite the settings
  5894.  in config files, and the reset option is useful for cases where the option
  5895.  is set by default, in the configuration file.
  5896.  
  5897.    All utilities can read a sequence of data files. However, the last
  5898.  transformation matrices found (VIEW_MAT and PRSP_MAT) are actually used.
  5899.  
  5900.  Example:
  5901.  
  5902.  poly3d-h solid1.dat | x11drvs solid1.dat - solid1.mat 
  5903.  
  5904.  x11drvs will display the original solid1.dat file with its hidden version,
  5905.  as computed by poly3d-h, all with the solid1.mat, ignoring all other matrices
  5906.  in the data stream.
  5907.  
  5908.  Under unix, compressed files with a postfix ".Z" will be automatically
  5909.  uncompressed on read and write. The following is legal under unix,
  5910.  
  5911.  poly3d-h solid1.dat.Z | x11drvs solid1.dat.Z - solid1.mat
  5912.  
  5913.  where solid1.dat.Z was saved from within IRIT using the command
  5914.  
  5915.  save( "solid1.dat.Z", solid1 );
  5916.  
  5917.  or similar. The unix system's "compress" and "zcat" are used for the purpose
  5918.  of (un)compressing the data via pipes. See also SAVE and LOAD.
  5919. $
  5920.  
  5921.  
  5922. Poly3d-h - Hidden Line Removing Program
  5923.  
  5924.  
  5925.  
  5926.  
  5927.     poly3d-h is a program to remove hidden lines from a given polygonal model.
  5928.  Freeform objects are preprocessed into polygons with controlled fineness.
  5929.  
  5930.     The program performs 4 passes over the input:
  5931.  
  5932.  1. Preprocesses and maps all polygons in a scene, and sorts them.
  5933.  
  5934.  2. Generates edges out of the polygonal model and sorts them (preprocessing
  5935.     for the scan line algorithm) into buckets.
  5936.  
  5937.  3. Intersects edges, and splits edges with non-homogeneous visibility (the
  5938.     scan line algorithm).
  5939.  
  5940.  4. Applies a visibility test of each edge.
  5941.  
  5942.         This program can handle CONVEX polygons only. From IRIT one can
  5943.  ensure that a model consists of convex polygons only using the CONVEX command:
  5944.   CnvxObj = convex( Obj );
  5945.  just before saving it into a file. Surfaces are always decomposed into
  5946.  triangles.
  5947.  
  5948.     poly3d-h output is in the form of polylines. It is a regular IRIT data
  5949.  file that can be viewed using any of the display devices, for example.
  5950.  
  5951.  
  5952.  poly3d-h [-b] [-m] [-i] [-e #Edges] [-H] [-4] [-W Width]
  5953.         [-F PolyOpti FineNess] [-q] [-o OutName] [-c] [-z] DFiles > OutFile
  5954.  
  5955.   -b: BackFacing - if an object is closed (such as most models created by
  5956.        IRIT), back facing polygons can be deleted, therefore speeding up
  5957.        the process by at least a factor of two.
  5958.   -m: More - provides some more information on the data file(s) parsed.
  5959.   -i: Internal edges (created by IRIT) - default is not to
  5960.        display them, and this option will force displaying them as well.
  5961.   -e n: Number of edges to use from each given polygon (default all).
  5962.        Handy as '-e 1 -4' for freeform data.
  5963.   -H: Dumps both visible lines and hidden lines as separated objects.
  5964.        Hidden lines will be dumped using a different (dimmer) color and (a
  5965.        narrower) line width.
  5966.   -4: Forces four polygons per almost flat region in the surface to
  5967.        polygon conversion. Otherwise two polygons only.
  5968.   -W Width: Selects a default width for visible lines in inches.
  5969.   -F PolyOpti FineNess: Optimality of polygonal approximation of
  5970.        surfaces. See the variable POLY_APPROX_OPT for the meaning of
  5971.        FineNess. See also -4.
  5972.   -q: Quiet mode. No printing aside from fatal errors. Disables -m.
  5973.   -o OutName: Name of output file. Default is stdout.
  5974.   -z: Prints version number and current defaults.
  5975.   -c: Clips data to screen (default). If disabled ('-c-'), data
  5976.        outside the view screen ([-1, 1] in x and y) are also processed.
  5977.  
  5978.    Some of the options may be turned on in poly3d-h.cfg. They can be then
  5979.  turned off in the command line as '-?-'.
  5980.  
  5981.  
  5982.    The program can be configured using a configuration file named poly3d-h.cfg.
  5983.    This is a plain ASCII file you can edit directly and set the parameters
  5984.  according to the comments there. 'poly3d-h -z' will display the current
  5985.  configuration as read from the configuration file.
  5986.  
  5987.    The configuration file is searched in the directory specified by the
  5988.  IRIT_PATH environment variable. For example,
  5989.  'setenv IRIT_PATH /u/gershon/irit/bin/'.
  5990.    If the IRIT_PATH variable is not set, the current directory is searched.
  5991.  
  5992.  
  5993.    As this program is not interactive, usage is quite simple, and the only
  5994.  control available is using the command line options.
  5995.  
  5996. $
  5997.  
  5998.    If a certain surface should be polygonized into a finer/caurser
  5999.  set of polygons than the rest of the scene, one can set a "resolution"
  6000.  attribute which specifies the relative FineNess resolution of this
  6001.  specific surface. Further, "u_resolution" and "v_resolution" might be
  6002.  similarly used to set relative resolution for the u or v direction only.
  6003.  
  6004.  
  6005. Poly3d-r - A Simple Data Rendering Program
  6006.  
  6007.  Retired. Sources can be found in the contrib directory, but this program is
  6008.  no longer supported. See irender program instead.
  6009. $
  6010.  
  6011. Illustrt - Simple line illustration filter
  6012.  
  6013.  
  6014.  
  6015.  illustrt is a filter that processes IRIT data files and dumps out modified
  6016.  IRIT data files. illustrt can be used to make simple nice illustrations of
  6017.  data. The features of illustrt include depth sorting, hidden line clipping 
  6018.  at intersection points, and vertex enhancements. illustrt is designed to
  6019.  closely interact with irit2ps, although it is not neceessary to use irit2ps
  6020.  on illustrt output.
  6021.  
  6022.  
  6023.  
  6024.    illustrt [-I #IsoLines] [-S #SampPerCrv] [-s] [-M] [-P] [-p]
  6025.             [-l MaxLnLen] [-a] [-t TrimInter] [-o OutName] [-Z InterSameZ]
  6026.             [-m] [-z] DFiles
  6027.  
  6028.   -I #IsoLines: Specifies number of isolines per surface, per direction.
  6029.   -S #SampPerCrv: Specifies the samples per (iso)curve.
  6030.   -s: sorts the data in Z depth order that emulates hidden line removal
  6031.         once the data are drawn.
  6032.   -M: Dumps the control mesh/polygon as well.
  6033.   -P: Dumps the curve/surface as isocurves.
  6034.   -p: Dumps vertices of polygons/lines as points.
  6035.   -l MaxLnLen: breaks long lines into shorter ones with maximal length
  6036.         of MaxLnLen. This option is necessary to achieve good depth depending
  6037.         line width in the '-d' option of irit2ps.
  6038.   -a: takes into account the angle between the two (poly)lines that
  6039.         intersect when computing how much to trim. See also -t.
  6040.   -t TrimInter: Each time two (poly)line segments intersect in the
  6041.         projection plane, the (poly)line that is farther away from the
  6042.         viewer is clipped TrimInter amount from both sides. See also -a.
  6043.   -o OutName: Name of output file. Default is stdout.
  6044.   -Z InterSameZ: The maximal Z depth difference of intersection curves
  6045.         to be be considered invalid.
  6046.   -m: More talkative mode. Prints processing information.
  6047.   -z: Prints version number and current defaults.
  6048.  
  6049.  
  6050.     illustrt is a simple line illustration tool. It process geometry such
  6051.  as polylines and surfaces and dumps geometry with attributes that will make
  6052.  nice line illustrations. illustrt is geared mainly toward its use with
  6053.  irit2ps to create postscript illustrations. Here is a simple example:
  6054.  
  6055.  illustrt -s -l 0.1 solid1.dat | irit2ps -W 0.05 -d 0.2 0.6 -u - > solid.ps
  6056.  
  6057.  make sure all segments piped into irit2ps are shorter than 0.1 and sort them
  6058.  in order to make sure hidden surface removal is correctly applied. Irit2ps
  6059.  is invoked with depth cueing activated, and a default width of 0.05.
  6060.  
  6061.     illustrt dumps out regular IRIT data files, so output can be handled
  6062.  like any other data set. illustrt does the following processing to the input
  6063.  data set:
  6064.  
  6065.   Converts surfaces to isocurves ('-I' flag) and isocurves and curves to
  6066.   polylines ('-S' flag), and converts polygons to polylines.
  6067.     Polygonal objects are considered closed and even though each edge is
  6068.   shared by two polygons, only a single one is generated.
  6069.   Finds the intersection location in the projection plane of all segments in
  6070.   the input data set and trims away the far segment at both sides of the
  6071.   intersection point by an amount controlled by the '-t' and '-a' flags.
  6072.   Breaks polylines and long lines into short segments, as specified via the
  6073.   '-l' flag, so that width depth cueing can be applied more accurately
  6074.   (see irit2ps's '-d' flag) as well as the Z sorting.
  6075.   Generates vertices of polygons in the input data set as points in output data
  6076.   controlled via the '-p' flag.
  6077.   set.
  6078.   Applies a Z sort to the output data, if '-s', so drawing in order of the data
  6079.   will produce a properly hidden surface removal drawing.
  6080.  
  6081.  Here is a more complex example. Make sure tubular is properly set via
  6082.  "attrib(solid1, "tubular", 0.7);" and invoke:
  6083.  
  6084.  illustrt -s -p -l 0.1 -t 0.05 solid1.dat |
  6085.      irit2ps -W 0.05 -d 0.2 0.6 -p h 0.05 -u - > solid.ps
  6086.  
  6087.  makes sure all segments piped into irit2ps are shorter than 0.1, generates
  6088.  points for the vertices, sorts the data in order to make sure hidden surface
  6089.  removal is correctly applied, and trims the far edge by 0.05 at an
  6090.  intersection point. Irit2ps is invoked with depth cueing activated and a
  6091.  default width of 0.05, points are drawn as hollowed circles of default
  6092.  size 0.05, and lines are drawn tubular.
  6093.  
  6094.  Objects in the input stream that have an attribute by the name of
  6095.  "IllustrtNoProcess" are passed to the output unmodified.
  6096.    Objects in the input stream that have an attribute by the name of
  6097.  "SpeedWave" will have a linear segments added that emulate fast
  6098.  motion with the following attributes,
  6099.  "Randomness,DirX,DirY,DirZ,Len,Dist,LenRandom,DistRandom,Width".
  6100.    Objects in the input stream that have an attribute by the name of
  6101.  "HeatWave" will have a spiral curves added that emulate a heat wave
  6102.  in the +Z axis with the following attributes,
  6103.  "Randomness,Len,Dist,LenRandom,DistRandom,Width".
  6104.  Examples:
  6105.  
  6106.  attrib(Axis, "IllustrtNoProcess", "");
  6107.  attrib(Obj, "SpeedWave", "0.0005,1,0,0,5,3,3,2,0.05");
  6108.  attrib(Obj, "HeatWave", "0.015,0.1,0.03,0.06,0.03,0.002");
  6109. $
  6110.  
  6111.  
  6112. Irender - Simple Scan Line Renderer
  6113.  
  6114.  
  6115.  
  6116.     irender is a program to render IRIT scenes into images. It is
  6117.  a software based Z buffer that is able to create images in few formats.
  6118.  Several of its features includes parametric and volumetric texture mapping,
  6119.  shadow computations, transparency and antialiasing.
  6120.  
  6121.  Freeform objects are preprocessed into polygons with controlled fineness.
  6122.  
  6123.  
  6124.   irender [-z] [-v] [-s XSize YSize] [-a Ambient] [-b R G B] [-B]
  6125.           [-F PolyOpti FineNess] [-f PolyOpti SampPerCrv]
  6126.           [-M Flat/Gouraud/Phong] [-P WMin [WMax]] [-S] [-T]
  6127.           [-A FilterName] [-Z] [-n] [-i rle/ppm] files
  6128.  
  6129.   -z: Prints version number and current defaults.
  6130.   -v: Verbose mode. Prints informative messages as it progresses.
  6131.   -s XSize YSize: Sets the size of the output image, in pixels.
  6132.         Default to 512x512.
  6133.   -a Ambient: Sets the ambient lighting fraction. Between zero (no
  6134.         ambient lighting) and one. Default to 0.2.
  6135.   -b R G B: Sets the background color. Each of thre R,G,B colors is
  6136.         an integer value between zero and 255. Default to black.
  6137.   -B : Apply back face culling. Somewhat faster, but only correct for
  6138.         closed objects. Default is no back face culling.
  6139.   -F PolyOpti FineNess: Optimality of polygonal approximation of
  6140.         surfaces. See the variable POLY_APPROX_OPT for the meaning of
  6141.         FineNess. Default is 0 and 20.0 (no optimal sampling with fineness
  6142.         of 20.0 (real number)).
  6143.   -f PolyOpti SampPerCrv: Controls the method used to approximate curves
  6144.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  6145.         Otherwise, an adaptive subdivision that optimizes the samples is
  6146.         employed. Default is 0 64 (no optimal sampling with 64 samples).
  6147.   -M Flat/Gouraud/Phong: Selects the shader to be used. Default to
  6148.         Phong if has normals of vertices, Flat if no normals are found.
  6149.   -P WMin [WMax]: Width of rendered polyline, in pixels. If only
  6150.         WMin is specified, all polylines are set to have WMin width. Otherwise,
  6151.         if WMax is prescribed as well, polylines' width is set to be
  6152.         proportional to their depth with WMax is the width of closest polyline
  6153.         and WMin the farest polyline.
  6154.   -S: Enable shadow computation. No shadows will be rendered without -S.
  6155.   -T: Enable transparency computation. No transparent object will be
  6156.         processed without -T.
  6157.   -A FilterName: Selects an antialiasing filter. FilterName can be one
  6158.         of 'none', 'box', 'triangle', 'quadratic', 'cubic', 'catrom',
  6159.         'mitchell', 'gaussian', 'sinc, and 'bessel'. Default is 'none'.
  6160.   -Z: Output will be in the form of Z depth instead of a color image.
  6161.         Output will be 32 bits depth instead of RGBA.
  6162.   -n: Reverses the normals of vertices and planes, globally.
  6163.   -i rle/ppm: Selects output image type. Currently the Utah Raster
  6164.         Toolkit's (URT) rle format is being supported as well as the PPM
  6165.         format.
  6166.  
  6167.    Some of the options may be turned on in irender.cfg. They can be then
  6168.  turned off in the command line as '-?-'.
  6169.  
  6170.  
  6171.    The program can be configured using a configuration file named irender.cfg.
  6172.    This is a plain ASCII file you can edit directly and set the parameters
  6173.  according to the comments there. 'irender -z' will display the current
  6174.  configuration as read from the configuration file.
  6175.  
  6176.    The configuration file is searched in the directory specified by the
  6177.  IRIT_PATH environment variable. For example,
  6178.  'setenv IRIT_PATH /u/gershon/irit/bin/'.
  6179.    If the IRIT_PATH variable is not set, the current directory is searched.
  6180.  
  6181.  
  6182.    As this program is not interactive, usage is quite simple, and the only
  6183.  control available is using the command line options.
  6184.  
  6185.  
  6186.  
  6187.    One can specify several attributes that affect the way the scene is
  6188.  rendered. The attributes can be generated within IRIT.
  6189.  See also the ATTRIB IRIT command.
  6190.  
  6191.    Surface color is controlled in two levels. If the object has an RGB
  6192.  attribute, it is used. Otherwise, a color as set via the IRIT COLOR
  6193.  command is used.
  6194.  
  6195.    If a certain surface should be finer/caurser than the rest of the
  6196.  scene, one can set a "resolution" attribute which specifies the
  6197.  relative FineNess resolution of this specific surface. Further,
  6198.  "u_resolution" and "v_resolution" might be similarly used to set
  6199.  relative resolution for the u or v direction only.
  6200.  
  6201.  Example:
  6202.  
  6203.  attrib( Ball, "rgb", "255,0,0" );
  6204.  color( Sphere, white );
  6205.  
  6206.     The cosine exponent of the phong shader can be set for a specific
  6207.  object via the SRF_COSINE attribute.
  6208.  
  6209.  Example:
  6210.  
  6211.  attrib( Ball, "srf_cosine", 16 );
  6212.    
  6213.     An object can be drawn transparent instead of opaque, if it has a
  6214.  "transp" attribute. A transparent value of one denotes a completely
  6215.  transparent object, while a value of zero means a completely opaque
  6216.  object. Transparent object will be rendered as such if and only if the '-T'
  6217.  command line option is set.
  6218.  
  6219.  Example:
  6220.  
  6221.  attrib( final, "transp", 0.5 );
  6222.  
  6223.  Several types of texture mapping are supported. Parametric texture may be
  6224.  attached to a parametric surface where the prescribed image is mapped onto
  6225.  the rectangular parametric domain of the surface.
  6226.  
  6227.  Example:
  6228.  
  6229.  attrib( Srf1, "ptexture", "checker.ppm" );
  6230.  
  6231.  The program will automatically detected a ppm file from an rle according to
  6232.  the file's name.
  6233.  
  6234.  A second type of texture mapping can be applied to all geometric objects.
  6235.  Herein, a procedural texture mapping is employed and currently only "wood"
  6236.  and "marble" are supported. A second parameter that must be provided for
  6237.  procedural textures is the scaling factor of the texture, which can be either
  6238.  one parameter of uniform scaling or a vector of three coefficients for
  6239.  scaling in x, y, and z. The two parameters are seperated by a comma.
  6240.  
  6241.  Example:
  6242.  
  6243.  attrib( Obj1, "texture", "marble, 2" );
  6244.  attrib( Obj2, "texture", "wood, 1 0.5 2.5" );
  6245.  
  6246.  which sets Obj1 to have a marble procedural texture with a uniform
  6247.  scaling factor of 2 and a wood texture for Obj2 with scaling factors
  6248.  of (1, 0.5, 2.5) in x, y, and z.
  6249.  
  6250.  In addition, a scalar surface spanning the same parameteric domain as an
  6251.  original surface may be used as texture mapping function.  Herein, the
  6252.  scalar function texture is evaluated at each UV parameter value and is mapped
  6253.  through a color scale to yield the output color.  This type of texture is
  6254.  useful for stress maps or analysis maps on top of freeform surfaces.
  6255.    Several related attributes are supported: "stexture_scale" which prescribes
  6256.  the color scale image (only its first column is employed), and
  6257.  "stexture_bound" that sets the domain that will be clipped to the min max
  6258.  values. Funally, "stexture_func" can hold the functions "sqrt" or "abs"
  6259.  to be applied to the evaluated surface value.
  6260.  
  6261.  Example:
  6262.  
  6263.  attrib( Srf, "stexture", scrvtr( Srf, P1, off ) );
  6264.  attrib( Srf, "stexture_scale", "color_scale.ppm" );
  6265.  attrib( Srf, "stexture_func", "sqrt" );
  6266.  attrib( Srf, "stexture_bound", "0.0 100.0" );
  6267.  
  6268.  where scrvtr computes a scalar field to Srf that represents the
  6269.  sum of the squares of the principle curvatures.  The evaluated scalar
  6270.  texture surface's value is piped through a sqrt function.
  6271.  The first column of the image of color_scale.ppm is used to set
  6272.  the coloring scale for curvature bounds values between 0.0 and 100.0.
  6273.  
  6274.  Both "stexture_scale" and "stexture_bound" are optional.  The default
  6275.  color scale maps the min/max values from blue to red through green. The
  6276.  default scalar surface texture bound is computed as the extreme values of
  6277.  the "stexture" surface.
  6278.  
  6279.  While the program has a default for lighting which is two light sources
  6280.  at opposite directions at (1, 1, 1) and (-1, -1, -1), one can overwrite
  6281.  this default. A POINT_TYPE object with LIGHT_SOURCE attribute denotes
  6282.  a light source.  If irender detects one or more light sources in the
  6283.  input stream, the default light sources are not created. Two types of
  6284.  light sources may be prescribed, a parallel at infinity or a point at
  6285.  finite distance light source, distinguished by a TYPE attribute of
  6286.  either POINT_POS or POINT_INFTY. A point light source can be colored,
  6287.  when an RGB attribute will set its color. A point light source will cast
  6288.  shadows if and only if it has SHADOW attribute (one needs to apply the '-S'
  6289.  command line option as well for rendering shadows). Finally, one can
  6290.  construct two mirrored light sources at opposite directions if TWOLIGHT
  6291.  attribute is added to the light source object.
  6292.  
  6293.  Example:
  6294.  
  6295.     Light1 = point( 0, 0, 10 );
  6296.     attrib( Light1, "light_source", on );
  6297.     attrib( Light1, "shadow", on );
  6298.     attrib( Light1, "rgb", "255,0,0" );
  6299.     attrib( Light1, "type", "point_pos" );
  6300.  
  6301.     Light2 = point( 1, 1, 1 );
  6302.     attrib( Light2, "light_source", on );
  6303.     attrib( Light2, "twolight", on );
  6304.     attrib( Light2, "type", "point_infty" );
  6305.  
  6306.  constructs two lights sources with Light1 with red color positioned
  6307.  at (0, 0, 10) and casting shadows, while Light2 will create two
  6308.  mirrored white parallel lights sources in the direction of (1, 1, 1) and
  6309.  (-1, -1, -1), as is irender's default.
  6310. $
  6311.  
  6312. DAT2BIN - Data To Binary Data file filter
  6313.  
  6314.  
  6315.    dat2bin [-t] [-z] DFiles
  6316.  
  6317.   -t: Dumps data to stdout as text instead of binary.
  6318.   -z: Print version number and current defaults.
  6319.  
  6320.  
  6321.     It may be sometimes desired to convert .dat data files into a binary form,
  6322.  for example, for fast loading of files with large geometry. Binary files can
  6323.  be somewhat larger, are unreadable in editors but are much faster to load in.
  6324.  A binary file must have a '.bdt' file type.
  6325.  
  6326.  Example:
  6327.  
  6328.    dat2bin b58polys.dat > b58polys.bdt
  6329.    dat2bin -t b58polys.bdt | more
  6330.  
  6331.  to convert a text file b58polys.dat into a binary file b58polys.bdt and
  6332.  to view the content of the binary file by converting it back to text. At
  6333.  this time data through pipes must be in text. That is, the following is
  6334.  illegal:
  6335.  
  6336.    dat2bin b58polys.dat | xglmdrvs -
  6337.  
  6338.  It should be remembered that the binary format is not documented and
  6339.  it might change in the future. Moreover, it is machine dependent and can
  6340.  very well may be unreadible between different platforms.
  6341. $
  6342.  
  6343. DAT2IRIT - Data To IRIT file filter
  6344.  
  6345.   Converts '.dat' and '.bdt' data files to '.irt' IRIT scripts.
  6346.  
  6347.  
  6348.    dat2irit [-z] DFiles
  6349.  
  6350.   -z: Print version number and current defaults.
  6351.  
  6352.  
  6353.     It may be sometimes desired to convert .dat data files into a form that
  6354.  can be fed back to IRIT - a '.irt' file. This filter does exactly that.
  6355.  
  6356.  Example:
  6357.  
  6358.    dat2irit b58.dat > b58-new.irt
  6359. $
  6360.  
  6361. DXF2IRIT - DXF (Autocad) To IRIT filter
  6362.  
  6363.    Due to lack of real documentation on the DXF format (for surfaces), this
  6364.  filter is not really complete. It only work for polygons, and is provided
  6365.  here only for those desperate enough to try and fix it...
  6366. $
  6367.  
  6368. IRIT2DXF - IRIT To DXF (Autocad) filter
  6369.  
  6370.    Due to lack of real documentation on the DXF format (for surfaces), this
  6371.  filter is not really complete. It works only for polygons, and is provided
  6372.  here only for those desperate enough to try and fix it...
  6373. $
  6374.  
  6375. IRIT2Hgl - IRIT To HPGL filter
  6376.  
  6377.  Converts IRIT geometry into the HL Graphics Language used by HP's plotters.
  6378.  
  6379.  
  6380.   irit2hgl [-t XTrans YTrans] [-I #UIso[:#VIso[:#WIso]]]
  6381.        [-f PolyOpti SampPerCrv] [-F PolyOpti FineNess] [-M] [-G] [-T]
  6382.        [-i] [-o OutName] [-z] DFiles
  6383.  
  6384.   -t XTrans YTrans: X and Y translation. of the image. Default is (0, 0).
  6385.   -I #UIso[:#VIso]: Specifies the number of isolines per surface, per
  6386.         direction. If #VIso is not specified, #UIso is used for #VIso as
  6387.         well.
  6388.   -f PolyOpti SampPerCrv: Controls the method used to approximate curves
  6389.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  6390.         Otherwise, an adaptive subdivision that optimizes the samples is
  6391.         employed.
  6392.   -F PolygonOpti FineNess: Optimality of polygonal approximation of
  6393.         surfaces. See the variable POLY_APPROX_OPT for the meaning of
  6394.         FineNess. See also -4. This enforces the dump of freefrom geometry
  6395.         as polygons.
  6396.   -M: Dumps the control mesh/polygon as well.
  6397.   -G: Dumps the freeform geometry.
  6398.   -T: Talkative mode. Prints processing information.
  6399.   -i: Internal edges (created by IRIT) - default is not to
  6400.        display them, and this option will force displaying them as well.
  6401.   -o OutName: Name of output file. By default the name of the first data
  6402.        file from DFiles list is used.  See below on the output files.
  6403.   -z: Prints version number and current defaults.
  6404.  
  6405.  
  6406.     Irit2Hgl converts freeform surfaces and polygons into polylines in a format
  6407.  that can be used by HPGL.
  6408.   
  6409.  Example:
  6410.  
  6411.  irit2Hgl -M -f 0 16 saddle.dat > saddle.hgl
  6412.  
  6413.    However, one can overwrite the viewing matrix by appending a new matrix
  6414.  in the end of the command line, created by the display devices:
  6415.  
  6416.  x11drvs b58.dat
  6417.  irit2Hgl -M -f 0 16 b58.dat irit.mat > saddle.hgl
  6418.  
  6419.  where irit.mat is the viewing matrix created by x11drvs.
  6420. $
  6421.  
  6422. IRIT2IV - IRIT To SGI's Inventor filter
  6423.  
  6424.  IV is the format used by the Inventor modeling/rendering package from SGI.
  6425.  
  6426.  
  6427.   irit2iv [-l] [-4] [-P] [-F PolyOpti FineNess] [-f PolyOpti SampPerCrv]
  6428.                                                              [-T] [-z] DFiles
  6429.  
  6430.   -l: Linear - forces linear (degree two) surfaces to be approximated
  6431.        by a single polygon along their linear direction.
  6432.        Although, most of the time, linear direction can be exactly represented
  6433.        using a single polygon, even a bilinear surface can have a free form
  6434.        shape (saddle like) that is not representable using a single polygon.
  6435.        Note that although this option will better emulate the surface shape,
  6436.        it will create unnecessary polygons in cases where one is enough.
  6437.   -4: Four - Generates four polygons per flat patch. Default is 2.
  6438.   -P: Polygonize freeform shapes. Default is to leave freeform curves
  6439.        and surfaces as is.
  6440.   -F PolyOpti FineNess: Optimality of polygonal approximation of
  6441.        surfaces. See the variable POLY_APPROX_OPT for the meaning of
  6442.        FineNess. See also -4.
  6443.   -f PolyOpti SampPerCrv: Controls the method used to approximate curves
  6444.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  6445.         Otherwise, an adaptive subdivision that optimizes the samples is
  6446.         employed.
  6447.   -T: Talkative mode. Prints processing information.
  6448.   -z: Prints version number and current defaults.
  6449.  
  6450.  
  6451.     Irit2Iv converts freeform surfaces and polygons into polygons and
  6452.  saved in iv Inventor's ascii file format.
  6453.   
  6454.  Example:
  6455.  
  6456.  irit2iv solid1.dat > solid1.iv
  6457.  
  6458.     Surfaces are converted to polygons with fineness control:
  6459.   
  6460.  irit2iv -F 0 16 - view.mat < saddle.dat > saddle.iv
  6461.  
  6462.     Note the use of '-' for stdin.
  6463. $
  6464.  
  6465. IRIT2NFF - IRIT To NFF filter
  6466.  
  6467.  
  6468.   irit2nff [-l] [-4] [-c] [-F PolyOpti FineNess] [-o OutName] [-T] [-g]
  6469.                                                                   [-z] DFiles
  6470.  
  6471.   -l: Linear - forces linear (degree two) surfaces to be approximated
  6472.        by a single polygon along their linear direction.
  6473.        Although, most of the time, linear direction can be exactly represented
  6474.        using a single polygon, even a bilinear surface can have a free-form
  6475.        shape (saddle-like) that is not representable using a single polygon.
  6476.        Note that although this option will better emulate the surface shape,
  6477.        it will create unnecessary polygons in cases where one is enough.
  6478.   -4: Four - Generates four polygons per flat patch. Default is 2.
  6479.   -c: Output files should be filtered by cpp. When set, the usually
  6480.        huge geometry file is separated from the main nff file that contains
  6481.        the surface properties and view parameters. By default all data,
  6482.        including the geometry, are saved into a single file with type extension
  6483.        '.nff'. Use of '-c' will pull out all the geometry into a file with
  6484.        the same name but a '.geom' extension, which will be included using the
  6485.        '#include' command. The '.nff' file should, in that case, be
  6486.        preprocessed using cpp before being piped into the nff renderer.
  6487.   -F PolyOpti FineNess: Optimality of polygonal approximation of
  6488.        surfaces. See the variable POLY_APPROX_OPT for the meaning of
  6489.        FineNess. See also -4.
  6490.   -o OutName: Name of output file. By default the name of the first data
  6491.        file from the DFiles list is used.  See below on the output files.
  6492.   -g: Generates the geometry file only. See below.
  6493.   -T: Talkative mode. Prints processing information.
  6494.   -z: Prints version number and current defaults.
  6495.  
  6496.  
  6497.     Irit2Nff converts freeform surfaces into polygons in a format that can
  6498.  be used by an NFF renderer. Usually, one file is created with '.nff' type
  6499.  extension. Since the number of polygons can be extremely large, a '-c'
  6500.  option is provided, which separates the geometry from the surface
  6501.  properties and view specification, but requires preprocessing by cpp.
  6502.  The geometry is isolated in a file with extension '.geom' and included
  6503.  (via '#include') in the main '.nff' file. The latter holds the surface
  6504.  properties for all the geometry as well as the viewing specification.
  6505.  This allows for the changing of shading or the viewing properties while
  6506.  editing small ('.nff') files.
  6507.  
  6508.     If '-g' is specified, only the '.geom' file is created, preserving the
  6509.  current '.nff' file. The '-g' flag can be specified only with '-c'.
  6510.  
  6511.     In practice, it may be useful to create a low resolution approximation
  6512.  of the model, change viewing/shading parameters in the '.nff' file until
  6513.  a good view and/or surface quality is found, and then run Irit2Nff once more
  6514.  to create a high resolution approximation of the geometry using '-g'.
  6515.  
  6516.  Example:
  6517.  
  6518.  irit2nff -c -l -F 0 8 b58.dat
  6519.  
  6520.  creates b58.nff and b58.geom with low resolution (FineNess of 5).
  6521.  
  6522.  Once done with parameter setting, a fine approximation of the model can
  6523.  be created with:
  6524.  
  6525.  irit2nff -c -l -g -F 0 64 b58.dat
  6526.  
  6527.  which will only recreate b58.geom (because of the -g option).
  6528.  
  6529.  One can overwrite the viewing matrix by appending a new matrix in the
  6530.  end of the command line, created by a display device:
  6531.  
  6532.  xgldrvs b58.dat
  6533.  irit2nff -l -F 0 32 b58.dat irit.mat
  6534.  
  6535.  where irit.mat is the viewing matrix created by xgldrvs.
  6536.  
  6537.  
  6538.    One can specify surface qualities for individual surfaces of a model.
  6539.  Several such attributes are supported by Irit2Nff and can be set within
  6540.  IRIT. See also the ATTRIB IRIT command.
  6541.  
  6542.    If a certain surface should be finer/caurser than the rest of the
  6543.  scene, one can set a "resolution" attribute which specifies the
  6544.  relative FineNess resolution of this specific surface. Further,
  6545.  "u_resolution" and "v_resolution" might be similarly used to set
  6546.  relative resolution for the u or v direction only.
  6547.  
  6548.  Example:
  6549.  
  6550.  attrib( srf1, "resolution", 2 );
  6551.  
  6552.  will force srf1 to have twice the default resolution, as set via the '-f'
  6553.  flag.
  6554.  
  6555.    Almost flat patches are converted to polygons. The rectangle can be
  6556.  converted into two polygons (by subdividing along one of its diagonals) or
  6557.  into four by introducing a new point at the center of the patch. This
  6558.  behavior is controlled by the '-4' flag, but can be overwritten for
  6559.  individual surfaces by setting a "twoperflat" or a "fourperflat" attribute.
  6560.  
  6561.    NFF specific properties are controlled via the following attributes:
  6562.  "kd", "ks", "shine", "trans", "index". Refer to the NFF manual for detail.
  6563.  
  6564.  Example:
  6565.  
  6566.  attrib( srf1, "kd", 0.3 );
  6567.  attrib( srf1, "shine", 30 );
  6568.  
  6569.    Surface color is controlled in two levels. If the object has an RGB
  6570.  attribute, it is used. Otherwise, a color, as set via the IRIT COLOR
  6571.  command, is used if set.
  6572.  
  6573.  Example:
  6574.  
  6575.  attrib( tankBody, "rgb", "244,164,96" );
  6576. $
  6577.  
  6578. IRIT2PLG - IRIT To PLG (REND386) filter
  6579.  
  6580.  PLG is the format used by the rend386 real time renderer for the IBM PC.
  6581.  
  6582.  
  6583.   irit2plg [-l] [-4] [-F PolyOpti FineNess] [-T] [-z] DFiles
  6584.  
  6585.   -l: Linear - forces linear (degree two) surfaces to be approximated
  6586.        by a single polygon along their linear direction.
  6587.        Although, most of the time, linear direction can be exactly represented
  6588.        using a single polygon, even a bilinear surface can have a free form
  6589.        shape (saddle like) that is not representable using a single polygon.
  6590.        Note that although this option will better emulate the surface shape,
  6591.        it will create unnecessary polygons in cases where one is enough.
  6592.   -4: Four - Generates four polygons per flat patch. Default is 2.
  6593.   -F PolyOpti FineNess: Optimality of polygonal approximation of
  6594.        surfaces. See the variable POLY_APPROX_OPT for the meaning of
  6595.        FineNess. See also -4.
  6596.   -T: Talkative mode. Prints processing information.
  6597.   -z: Prints version number and current defaults.
  6598.  
  6599.  
  6600.     Irit2Plg converts freeform surfaces and polygons into polygons in a
  6601.  format that can be used by the REND386 renderer. 
  6602.   
  6603.  Example:
  6604.  
  6605.  irit2plg solid1.dat > solid1.plg
  6606.  
  6607.     Surfaces are converted to polygons with fineness control:
  6608.   
  6609.  irit2plg -F 0 16 - view.mat < saddle.dat > saddle.plg
  6610.  
  6611.     Note the use of '-' for stdin.
  6612. $
  6613.  
  6614. IRIT2PS - IRIT To PS filter
  6615.  
  6616.  
  6617.   irit2ps [-l] [-4] [-s Size] [-I #UIso[:#VIso[:#WIso]]] [-F PolyOpti FineNess]
  6618.           [-f PolyOpti SampPerCrv] [-M] [-G] [-P] [-W LineWidth]
  6619.           [-w WidenLen WidenWidth] [-b R G B] [-B X1 Y1 X2 Y2] [-c] [-C]
  6620.           [-T] [-i] [-o OutName] [-d [Zmin Zmax]] [-D [Zmin Zmax]]
  6621.           [-p PtType PtSize] [-u] [-z] DFiles
  6622.  
  6623.   -l: Linear - forces linear (degree two) surfaces to be approximated
  6624.         by a single polygon along their linear direction.
  6625.          Although most of the time, linear direction can be exactly represented
  6626.         using a single polygon, even a bilinear surface can have a free-form
  6627.         shape (saddle-like) that is not representable using a single polygon.
  6628.           Note that although this option will better emulate the surface shape,
  6629.         it will create unnecessary polygons in cases where one is enough.
  6630.   -4: Four - Generates four polygons per flat patch. Default is 2.
  6631.   -s Size: Controls the size of the postscript output in inches.
  6632.         Default is to fill the entire screen.
  6633.   -I #UIso[:#VIso[:#WIso]]: Specifies the number of isolines per
  6634.         surface/trivariate, per direction. If #VIso or #WIso is not
  6635.         specified, #UIso is used for #VIso etc.
  6636.   -F PolygonOpti FineNess: Optimality of polygonal approximation of
  6637.         surfaces. See the variable POLY_APPROX_OPT for the meaning of
  6638.         FineNess. See also -4.
  6639.   -f PolyOpti SampPerCrv: Controls the method used to approximate curves
  6640.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  6641.         Otherwise, an adaptive subdivision that optimizes the samples is
  6642.         employed.
  6643.   -M: Dumps the control mesh/polygon as well.
  6644.   -G: Dumps the curve/surface (as freeform geometry). Default. See -I,
  6645.         -C, -f for control on polyline approximation.
  6646.   -P: Dumps the curve/surface (as polygons). See -F, -l, -4 for control
  6647.         on polygonal approximation.
  6648.   -W #LineWidth: Sets the line drawing width in inches. Default is
  6649.         as thin as possible. This option will overwrite only those objects
  6650.         that do not have a "width" attribute. See also -d. If LineWidth
  6651.         is negative its absolute value is used to scale the current width
  6652.         of the object if has one, or the default width otherwise.
  6653.   -w WidenLen WidenWidth: If end points of polylines should be made
  6654.         wider, and if so to what width.
  6655.   -b R G B: Sets a colored background. RGB are three integers prescribing
  6656.         the Red, Green, and Blue coefficients. if no -c (i.e. a gray level
  6657.         drawing) this color is converted to a gray level using RGB to
  6658.         T.V. Y(IQ) channel conversion.
  6659.   -B X1 Y1 X2 Y2: Clips the drawing area outsize the bounding box
  6660.        from (X1, Y1) to (X2, Y2).
  6661.   -c: Creates a color postscript file.
  6662.   -C: Curve mode. Dumps freeform curves and surfaces as cubic
  6663.        Bezier curves. Higher order curves and surfaces and/or rationals are
  6664.        approximated by cubic Bezier curves. This option generates data
  6665.        files that are roughly a third of piecewise linear postscript files
  6666.        (by disabling this feature, -C-), but takes a longer time to compute.
  6667.   -T: Talkative mode. Prints processing information.
  6668.   -i: Internal edges (created by IRIT) - the default is not to
  6669.        display them, and this option will force displaying them as well.
  6670.   -o OutName: Name of output file. Default is stdout.
  6671.   -d [Zmin Zmax]: Sets the ratios between the depth cue and the width of
  6672.         the dumped data. See also -W, -p. Closer lines/points will be drawn
  6673.         wider/larger. Zmin and Zmax are optional. The object's bounding
  6674.         box is otherwise computed and used.
  6675.   -D [Zmin Zmax]: Same as -d, but depth cue the color or gray scale
  6676.         instead of width. You might need to consider the sorting option
  6677.         of the illustrt tool (-s of illustrt) for proper drawings.
  6678.         Only one of -d and -D can be used.
  6679.   -p PtType PtSize: Specifies the way points are drawn.
  6680.         PtType can be one of H, F, C for Hollow circle, Full Circle, or
  6681.         Cross. PtSize specifies the size of the point to be drawn, in inches.
  6682.         Vectors will also be drawn as points, but with an additional thin
  6683.         line to the origin. See also -d.
  6684.   -u: Forces a unit matrix transformation, i.e. no transformation.
  6685.   -z: Prints version number and current defaults.
  6686.  
  6687.  
  6688.     Irit2Ps converts freeform surfaces and polygons into a postscript file.
  6689.   
  6690.  Example:
  6691.  
  6692.  irit2ps solid1.dat > solid1.ps
  6693.  
  6694.     Surfaces are converted to polygons with fineness control:
  6695.   
  6696.  irit2ps -f 0 32 -c -W 0.01 saddle.dat > saddle.ps
  6697.  
  6698.  creates a postscript file for the saddle model, in color, and with
  6699.  lines 0.01 inch thick.
  6700.  
  6701.  
  6702.    One can specify several attributes that affect the way the postscript
  6703.  file is generated. The attributes can be generated within IRIT.
  6704.  See also the ATTRIB IRIT command.
  6705.  
  6706.    If a certain object should be thinner or thicker than the rest of the scene,
  6707.  one can set a "width" attribute which specifies the line width in inches of
  6708.  this specific object.
  6709.  
  6710.  Example:
  6711.  
  6712.  attrib( srf1, "width", 0.02 );
  6713.  
  6714.  will force srf1 to have this width, instead of the default as set via the
  6715.  '-W' flag.
  6716.  
  6717.  If a (closed) object, a polygon for example, needs to be filled, a "fill"
  6718.  attribute should be set, with a value equal to the gray level desired.
  6719.  
  6720.  Example:
  6721.  
  6722.  attrib( poly, "fill", 0.5 );
  6723.  
  6724.  will fill poly with %50 gray.
  6725.  
  6726.  If an object, a polygon for example, needs to be painted in a gray level
  6727.  instead of black, a "gray" attribute should be set, with a value equal
  6728.  to the gray level desired.
  6729.  
  6730.  Example:
  6731.  
  6732.  attrib( poly, "gray", 0.5 );
  6733.  
  6734.  will draw poly with %50 gray.
  6735.  
  6736.  Dotted or dashed line effects can be created using a "dash" attribute which
  6737.  is a direct PostScript dash string. A simple form of this string is "[a b]"
  6738.  in which a is the drawing portion (black) in inches, followed by b inches
  6739.  of white space. See the postScript manual for more about the format of this
  6740.  string. Here is an example for a dotted-dash line.
  6741.  
  6742.  attrib( poly, "dash", "[0.006 0.0015 0.001 0.0015] 0" );
  6743.  
  6744.    Surface color is controlled (for color postscript only - see -c) in two
  6745.  levels. If the object has an RGB attribute, it is used. Otherwise, a color as
  6746.  set via the IRIT COLOR command is used.
  6747.  
  6748.  Example:
  6749.  
  6750.  attrib( Ball, "rgb", "255,0,0" );
  6751.  
  6752.     An object can be drawn as ``tubes'' instead of full lines. The ratio
  6753.  between the inner and the outer radii of the tube is provided as the
  6754.  TUBULAR attribute:
  6755.  
  6756.  attrib( final, "tubular", 0.7 );
  6757. $
  6758.  
  6759. IRIT2RAY - IRIT To RAYSHADE filter
  6760.  
  6761.  
  6762.   irit2ray [-l] [-4] [-G GridSize] [-F PolyOpti FineNess]
  6763.            [-f PolyOpti SampPerCrv] [-o OutName] [-g] [-p Zmin Zmax] [-P]
  6764.            [-M] [-T] [-I #UIso[:#VIso[:#WIso]]] [-s ObjSeq#] [-z] DFiles
  6765.  
  6766.   -l: Linear - forces linear (degree two) surfaces to be approximated
  6767.         by a single polygon along their linear direction.
  6768.          Although most of the time, linear direction can be exactly represented
  6769.         using a single polygon, even a bilinear surface can have a free-form
  6770.         shape (saddle-like) that is not representable using a single polygon.
  6771.           Note that although this option will better emulate the surface shape,
  6772.         it will create unnecessary polygons in cases where one is enough.
  6773.   -4: Four - Generates four polygons per flat patch. Default is 2.
  6774.   -G GridSize: Usually objects are grouped as lists of polygons.
  6775.         This flags will coerce the usage of the RAYSHADE grid structure,
  6776.         with GridSize being used as the grid size along the object
  6777.         bounding box's largest dimension.
  6778.   -F PolygonOpti FineNess: Optimality of polygonal approximation of
  6779.         surfaces. See the variable POLY_APPROX_OPT for the meaning of
  6780.         FineNess. See also -4.
  6781.   -f PolyOpti SampPerCrv: Controls the method used to approximate curves
  6782.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  6783.         Otherwise, an adaptive subdivision that optimizes the samples is
  6784.         employed.
  6785.   -o OutName: Name of output file. By default the name of the first data
  6786.         file from the DFiles list is used.  See below on the output
  6787.         files.
  6788.   -g: Generates the geometry file only. See below.
  6789.   -p Zmin Zmax: Sets the ratios between the depth cue and the width of
  6790.         the dumped polylines. See also -P. Closer lines will be drawn
  6791.         wider.
  6792.   -P: Forces dumping polygons as polylines with thickness controlled
  6793.         by -p.
  6794.   -M: If -P (see -P and -p) then converts the control mesh/polygon
  6795.         to polylines which are represented as a sequence of truncated
  6796.         cones.
  6797.   -T: Talkative mode. Prints processing information.
  6798.   -I #UIso[:#VIso[:#WIso]]: Specifies the number of isolines per
  6799.         surface/trivariate, per direction. If #VIso or #WIso is not
  6800.         specified, #UIso is used for #VIso etc.
  6801.   -s ObjSeq#: Sets object sequence number if no object name. Default 1.
  6802.   -z: Prints version number and current defaults.
  6803.  
  6804.  
  6805.     Irit2Ray converts freeform surfaces into polygons in a format that can
  6806.  be used by the RAYSHADE ray tracing program.
  6807.  Two files are created, one with a '.geom' extension and
  6808.  one with '.ray'. Since the number of polygons can be extremely large,
  6809.  the geometry is isolated in the '.geom' file and is included
  6810.  (via '#include') in the main '.ray' file. The latter holds the surface
  6811.  properties for all the geometry as well as viewing and RAYSHADE specific
  6812.  commands. This allows for the changing of the shading or the viewing
  6813.  properties while editing small ('.ray') files.
  6814.  
  6815.     If '-g' is specified, only the '.geom' file is created, preserving the
  6816.  current '.ray' file.
  6817.  
  6818.     In practice, it may be useful to create a low resolution approximation
  6819.  of the model, change the viewing/shading parameters in the '.ray' file until
  6820.  a good view and/or surface quality is found, and then run Irit2Ray once more
  6821.  to create a high resolution approximation of the geometry using '-g'.
  6822.  
  6823.  Example:
  6824.  
  6825.  irit2ray -l -F 0 8 b58.dat
  6826.  
  6827.  creates b58.ray and b58.geom with low resolution (FineNess of 5).
  6828.    At such low resolution it can very well may happen that triangles will have
  6829.  normals "over the edge" since a single polygon may approximate a highly
  6830.  curved surface. That will cause RAYSHADE to issue an
  6831.  "Inconsistent triangle normals" warning. This problem will not exist if
  6832.  high fineness is used.
  6833.    One can ray trace this scene using a command similar to:
  6834.  
  6835.  RAYSHADE -p -W 256 256 b58.ray > b58.rle
  6836.  
  6837.  Once done with parameter setting for RAYSHADE, a fine approximation of the
  6838.  model can be created with:
  6839.  
  6840.  irit2ray -l -g -F 0 64 b58.dat
  6841.  
  6842.  which will only recreate b58.geom (because of the -g option).
  6843.  
  6844.  Interesting effects can be created using the depth cue support and polyline
  6845.  conversion of irit2ray. For example
  6846.  
  6847.  irit2ray -G 5 -P -p -0.0 0.5 solid1.dat
  6848.  
  6849.  will dump solid1 as a set of polylines (represented as truncated cones in
  6850.  RAYSHADE) with varying thickness according to the z depth. Another example
  6851.  is
  6852.  
  6853.  irit2ray -G 5 -P -p -0.1 1.0 saddle.dat
  6854.  
  6855.  which dumps the isolines extracted from the saddle surface with varying
  6856.  thickness.
  6857.  
  6858.    Each time a data file is saved in IRIT, it can be saved with the
  6859.  viewing matrix of the last INTERACT by saving the VIEW_MAT object as well.
  6860.  I.e.:
  6861.  
  6862.  save( "b58", b58 );
  6863.  
  6864.    However one can overwrite the viewing matrix by appending a new matrix
  6865.  in the end of the command line, created by the display devices:
  6866.  
  6867.  os2drvs b58.dat
  6868.  irit2ray -l -F 0 16 b58.dat irit.mat
  6869.  
  6870.  where irit.mat is the viewing matrix created by os2drvs. The output name,
  6871.  by default, is the last input file name, so you might want to provide an
  6872.  explicit name with the -o flag.
  6873.  
  6874.  
  6875.    One can specify surface qualities for individual surfaces of a model.
  6876.  Several such attributes are supported by Irit2Ray and can be set within
  6877.  IRIT. See also the ATTRIB IRIT command.
  6878.  
  6879.    If a certain surface should be finer/caurser than the rest of the
  6880.  scene, one can set a "resolution" attribute which specifies the
  6881.  relative FineNess resolution of this specific surface. Further,
  6882.  "u_resolution" and "v_resolution" might be similarly used to set
  6883.  relative resolution for the u or v direction only.
  6884.  
  6885.  Example:
  6886.  
  6887.  attrib( srf1, "resolution", 2 );
  6888.  
  6889.  will force srf1 to have twice the default resolution, as set via the '-f'
  6890.  flag.
  6891.  
  6892.    Almost flat patches are converted to polygons. The rectangle can be
  6893.  converted into two polygons (by subdividing along one of its diagonals) or
  6894.  into four by introducing a new point at the patch center. This behavior is
  6895.  controlled by the '-4' flag, but can be overwritten for individual surfaces
  6896.  bu setting "twoperflat" or "fourperflat".
  6897.  
  6898.    RAYSHADE specific properties are controlled via the following attributes:
  6899.  "specpow", "reflect", "transp", "body", "index", and "texture". The value of
  6900.  this attributes must be strings as it is copied verbatim. Refer to
  6901.  RAYSHADE's manual for their meaning.
  6902.  
  6903.   Example:
  6904.  
  6905.  attrib( legs, "transp", "0.3" );
  6906.  attrib( legs, "texture", "wood,2" );
  6907.  attrib( table, "texture", "marble" );
  6908.  attrib( table, "reflect", "0.5" );
  6909.  
  6910.    Optional scale can be prescribed to textures. In the above example
  6911.  wooden legs' (that are also transparent...) texture is selected with
  6912.  texture's scaling factor of 2.
  6913.  
  6914.    Surface color is controlled in two levels. If the object has an RGB
  6915.  attribute, it is used. Otherwise a color as set via the IRIT COLOR
  6916.  command is being used if set.
  6917.  
  6918.  Example:
  6919.  
  6920.  attrib( tankBody, "rgb", "244,164,96" );
  6921. $
  6922.  
  6923. IRIT2Scn - IRIT To SCENE (RTrace) filter
  6924.  
  6925.  SCENE is the format used by the RTrace ray tracer. This filter was donated
  6926.  by Antonio Costa (acc@asterix.inescn.pt), the author of RTrace.
  6927.  
  6928.  
  6929.   irit2scn [-l] [-4] [-F PolyOpti FineNess] [-o OutName] [-g] [-T] [-z] DFiles
  6930.  
  6931.   -l: Linear - forces linear (degree two) surfaces to be approximated
  6932.        as a single polygon along their linear direction.
  6933.          Although most of the time, linear direction can be exactly represented
  6934.        using a single polygon, even a bilinear surface can have a free-form
  6935.        shape (saddle-like) that is not representable using a single polygon.
  6936.          Note that although this option will better emulate the surface shape,
  6937.        it will create unnecessary polygons in cases where one is enough.
  6938.   -4: Four - Generates four polygons per flat patch.
  6939.   -F PolyOpti FineNess: Optimality of polygonal approximation of
  6940.        surfaces. See the variable POLY_APPROX_OPT for the meaning of
  6941.        FineNess. See also -4.
  6942.   -o OutName: Name of output file. By default the name of the first data
  6943.        file from DFiles list is used.  See below on the output files.
  6944.   -g: Generates the geometry file only. See below.
  6945.   -T: Talkative mode. Prints processing information.
  6946.   -z: Prints version number and current defaults.
  6947.  
  6948.  
  6949.     Irit2Scn converts freeform surfaces and polygons into polygons in a format
  6950.  that can be used by RTrace. Two files are created, one with a '.geom'
  6951.  extension and one with '.scn'. Since the number of polygons can be extremely
  6952.  large, the geometry is isolated in the '.geom' file and is included
  6953.  (via '#include') in the main '.scn' file. The latter holds the surface
  6954.  properties for all the geometry as well as viewing and RTrace specific
  6955.  commands. This allows for the changing of the shading or the viewing
  6956.  properties while editing small ('.scn') files.
  6957.  
  6958.     If '-g' is specified, only the '.geom' file is created, preserving the
  6959.  current '.scn' file.
  6960.  
  6961.     In practice, it may be useful to create a low resolution approximation
  6962.  of the model, change the viewing/shading parameters in the '.scn' file
  6963.  until a good view and/or surface quality is found, and then run Irit2Scn once
  6964.  more to create a high resolution approximation of the geometry using '-g'.
  6965.  
  6966.  Example:
  6967.  
  6968.  irit2scn -l -F 0 8 b58.dat
  6969.  
  6970.  creates b58.scn and b58.geom with low resolution (FineNess of 5).
  6971.  
  6972.    One can ray trace this scene after converting the scn file to a sff file,
  6973.  using scn2sff provided with the RTrace package.
  6974.  
  6975.  Once done with the parameter setting of RTrace, a fine approximation of the
  6976.  model can be created with:
  6977.  
  6978.  irit2scn -l -g -F 0 64 b58.dat
  6979.  
  6980.  which will only recreate b58.geom (because of the -g option).
  6981.  
  6982.    One can overwrite the viewing matrix by appending a new matrix
  6983.  in the end of the command line, created by the display devices:
  6984.  
  6985.  wntdrvs b58.dat
  6986.  irit2scn -l -F 0 8 b58.dat irit.mat
  6987.  
  6988.  where irit.mat is the viewing matrix created by wntdrvs. The output name,
  6989.  by default, is the last input file name, so you might want to provide an
  6990.  explicit name with the -o flag.
  6991.  
  6992.  
  6993.    One can specify surface qualities for individual surfaces of a model.
  6994.  Several such attributes are supported by Irit2Scn and can be set within 
  6995.  IRIT. See also the ATTRIB IRIT command.
  6996.  
  6997.    If a certain surface should be finer/caurser than the rest of the
  6998.  scene, one can set a "resolution" attribute which specifies the
  6999.  relative FineNess resolution of this specific surface. Further,
  7000.  "u_resolution" and "v_resolution" might be similarly used to set
  7001.  relative resolution for the u or v direction only.
  7002.  
  7003.  Example:
  7004.  
  7005.  attrib( srf1, "resolution", 2 );
  7006.  
  7007.  will force srf1 to have twice the default resolution, as set via the '-f'
  7008.  flag.
  7009.  
  7010.    Almost flat patches are converted to polygons. The patch can be converted
  7011.  into two polygons (by subdividing along one of its diagonals) or into four
  7012.  by introducing a new point at the patch center. This behavior is controlled
  7013.  by the '-4' flag, but can be overwritten for individual surfaces bu setting
  7014.  "twoperflat" or "fourperflat".
  7015.  
  7016.    RTrace specific properties are controlled via the following attributes:
  7017.  "SCNrefraction", "SCNtexture", "SCNsurface. Refer to the RTrace manual for
  7018.  their meaning.
  7019.  
  7020.  Example:
  7021.  
  7022.  attrib( srf1, "SCNrefraction", 0.3 );
  7023.  
  7024.    Surface color is controlled in two levels. If the object has an RGB
  7025.  attribute, it is used. Otherwise a color as set via IRIT COLOR command
  7026.  is used if set.
  7027.  
  7028.  Example:
  7029.  
  7030.  attrib( tankBody, "rgb", "244,164,96" );
  7031. $
  7032.  
  7033. IRIT2Xfg - IRIT To XFIG filter
  7034.  
  7035.  
  7036.   irit2xfg [-s Size] [-t XTrans YTrans] [-I #UIso[:#VIso[:#WIso]]]
  7037.        [-f PolyOpti SampPerCrv] [-F PolyOpti FineNess] [-M] [-G] [-T]
  7038.        [-i] [-o OutName] [-z] DFiles
  7039.  
  7040.   -s Size: Size in inches of the page. Default is 7 inches.
  7041.   -t XTrans YTrans: X and Y translation. of the image. Default is (0, 0).
  7042.   -I #UIso[:#VIso]: Specifies the number of isolines per surface, per
  7043.         direction. If #VIso is not specified, #UIso is used for #VIso as
  7044.         well.
  7045.   -f PolyOpti SampPerCrv: Controls the method used to approximate curves
  7046.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  7047.         Otherwise, an adaptive subdivision that optimizes the samples is
  7048.         employed.
  7049.   -F PolygonOpti FineNess: Optimality of polygonal approximation of
  7050.         surfaces. See the variable POLY_APPROX_OPT for the meaning of
  7051.         FineNess. See also -4. This enforces the dump of freefrom geometry
  7052.         as polygons.
  7053.   -M: Dumps the control mesh/polygon as well.
  7054.   -G: Dumps the freeform geometry.
  7055.   -T: Talkative mode. Prints processing information.
  7056.   -i: Internal edges (created by IRIT) - default is not to
  7057.        display them, and this option will force displaying them as well.
  7058.   -o OutName: Name of output file. By default the name of the first data
  7059.        file from DFiles list is used.  See below on the output files.
  7060.   -z: Prints version number and current defaults.
  7061.  
  7062.  
  7063.     Irit2Xfg converts freeform surfaces and polygons into polylines in a format
  7064.  that can be used by XFIG.
  7065.   
  7066.  Example:
  7067.  
  7068.  irit2Xfg -T -f 0 16 saddle.dat > saddle.xfg
  7069.  
  7070.    However, one can overwrite the viewing matrix by appending a new matrix
  7071.  in the end of the command line, created by the display devices:
  7072.  
  7073.  x11drvs b58.dat
  7074.  irit2Xfg -T -f 0 16 b58.dat irit.mat > saddle.xfg
  7075.  
  7076.  where irit.mat is the viewing matrix created by x11drvs.
  7077. $
  7078.  
  7079. DATAFILE Format
  7080.  
  7081.    This section describes the data file format used to exchange data between
  7082.  IRIT and its accompanying tools.
  7083.  
  7084.  [OBJECT {ATTRS} OBJNAME
  7085.      [NUMBER n]
  7086.  
  7087.    | [VECTOR x y z]
  7088.  
  7089.    | [CTLPT POINT_TYPE {w} x y {z}]
  7090.  
  7091.    | [STRING "a string"]
  7092.  
  7093.    | [MATRIX m00 ... m03
  7094.              m10 ... m13
  7095.              m20 ... m23
  7096.              m30 ... m33]
  7097.  
  7098.      ;A polyline should be drawn from first point to last. Nothing is drawn
  7099.      ;from last to first (in a closed polyline, last point is equal to first).
  7100.    | [POLYLINE {ATTRS} #PTS                   ;#PTS = number of points.
  7101.          [{ATTRS} x y z]
  7102.          [{ATTRS} x y z]
  7103.             .
  7104.             .
  7105.             .
  7106.          [{ATTRS} x y z]
  7107.      ]
  7108.  
  7109.      ;Defines a closed planar region. Last point is NOT equal to first,
  7110.      ;and a line from last point to first should be drawn when the boundary
  7111.      ;of the polygon is drawn.
  7112.    | [POLYGON {ATTRS} #PTS
  7113.          [{ATTRS} x y z]
  7114.          [{ATTRS} x y z]
  7115.             .
  7116.             .
  7117.             .
  7118.          [{ATTRS} x y z]
  7119.      ]
  7120.  
  7121.      ;Defines a "cloud" of points.
  7122.    | [POINTLIST {ATTRS} #PTS
  7123.          [{ATTRS} x y z]
  7124.          [{ATTRS} x y z]
  7125.             .
  7126.             .
  7127.             .
  7128.          [{ATTRS} x y z]
  7129.      ]
  7130.  
  7131.      ;Defines a Bezier curve with #PTS control points. If the curve is
  7132.      ;rational, the rational component is introduced first.
  7133.    | [CURVE BEZIER {ATTRS} #PTS POINT_TYPE
  7134.          [{ATTRS} {w} x y z ...]
  7135.          [{ATTRS} {w} x y z ...]
  7136.             .
  7137.             .
  7138.             .
  7139.          [{ATTRS} {w} x y z ...]
  7140.      ]
  7141.  
  7142.      ;Defines a Bezier surface with #UPTS * #VPTS control points. If the
  7143.      ;surface is rational, the rational component is introduced first.
  7144.      ;Points are printed row after row (#UPTS per row), #VPTS rows.
  7145.    | [SURFACE BEZIER {ATTRS} #UPTS #VPTS POINT_TYPE
  7146.          [{ATTRS} {w} x y z ...]
  7147.          [{ATTRS} {w} x y z ...]
  7148.             .
  7149.             .
  7150.             .
  7151.          [{ATTRS} {w} x y z ...]
  7152.      ]
  7153.  
  7154.      ;Defines a Bezier trivariate with #UPTS * #VPTS * #WPTS control
  7155.      ;points. If the trivariate is rational, the rational component is
  7156.      ;introduced first. Points are printed row after row (#UPTS per row),
  7157.      ;#VPTS rows, #WPTS layers (depth).
  7158.    | [TRIVAR BEZIER {ATTRS} #UPTS #VPTS #WPTS POINT_TYPE
  7159.          [{ATTRS} {w} x y z ...]
  7160.          [{ATTRS} {w} x y z ...]
  7161.             .
  7162.             .
  7163.             .
  7164.          [{ATTRS} {w} x y z ...]
  7165.      ]
  7166.  
  7167.      ;Defines a Bspline curve of order ORDER with #PTS control points. If the
  7168.      ;curve is rational, the rational component is introduced first.
  7169.      ;Note length of knot vector is equal to #PTS + ORDER.
  7170.      ;If curve is periodic KVP prefix the knot vector that has length of
  7171.      ;'Length + Order + Order - 1'.
  7172.    | [CURVE BSPLINE {ATTRS} #PTS ORDER POINT_TYPE
  7173.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                    ;Knot vector
  7174.          [{ATTRS} {w} x y z ...]
  7175.          [{ATTRS} {w} x y z ...]
  7176.             .
  7177.             .
  7178.             .
  7179.          [{ATTRS} {w} x y z ...]
  7180.      ]
  7181.  
  7182.      ;Defines a Bspline surface with #UPTS * #VPTS control points, of order
  7183.      ;UORDER by VORDER. If the surface is rational, the rational component
  7184.      ;is introduced first.
  7185.      ;Points are printed row after row (#UPTS per row), #VPTS rows.
  7186.      ;If surface is periodic in some direction KVP prefix the knot vector
  7187.      ;that has length of 'Length + Order + Order - 1'.
  7188.    | [SURFACE BSPLINE {ATTRS} #UPTS #VPTS UORDER VORDER POINT_TYPE
  7189.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;U Knot vector
  7190.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;V Knot vector
  7191.          [{ATTRS} {w} x y z ...]
  7192.          [{ATTRS} {w} x y z ...]
  7193.             .
  7194.             .
  7195.             .
  7196.          [{ATTRS} {w} x y z ...]
  7197.      ]
  7198.  
  7199.      ;Defines a Bspline trivariate with #UPTS * #VPTS * #WPTS control
  7200.      ;points. If the trivariate is rational, the rational component is
  7201.      ;introduced first. Points are printed row after row (#UPTS per row),
  7202.      ;#VPTS rows, #WPTS layers (depth).
  7203.      ;If trivariate is periodic in some direction KVP prefix the knot vector
  7204.      ;that has length of 'Length + Order + Order - 1'.
  7205.    | [TRIVAR BSPLINE {ATTRS} #UPTS #VPTS #WPTS UORDER VORDER WORDER POINT_TYPE
  7206.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;U Knot vector
  7207.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;V Knot vector
  7208.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;W Knot vector
  7209.          [{ATTRS} {w} x y z ...]
  7210.          [{ATTRS} {w} x y z ...]
  7211.             .
  7212.             .
  7213.             .
  7214.          [{ATTRS} {w} x y z ...]
  7215.      ]
  7216.  
  7217.      ;Defines a trimmed surface. Encapsulates a surface (can be either a
  7218.      ;Bspline or a Bezier surface) and prescribes its trimming curves.
  7219.      ;There can be an arbitrary number of trimming curves (either Bezier
  7220.      ; or Bspline). Each trimming curve contains an arbitrary number of
  7221.      ;trimming curve segments, while each trimming curve segment contains
  7222.      ;a parameteric representation optionally followed by a Euclidean
  7223.      ;representation of the trimming curve segment.
  7224.    | [TRIMSRF
  7225.          [SURFACE ...
  7226.          ]
  7227.          [TRIMCRV
  7228.              [TRIMCRVSEG
  7229.                  [CURVE ...
  7230.                  ]
  7231.              ]
  7232.                 .
  7233.                 .
  7234.                 .
  7235.              [TRIMCRVSEG
  7236.                  [CURVE ...
  7237.                  ]
  7238.              ]
  7239.          ]
  7240.              .
  7241.              .
  7242.              .
  7243.          [TRIMCRV
  7244.              [TRIMCRVSEG
  7245.                  [CURVE ...
  7246.                  ]
  7247.              ]
  7248.                 .
  7249.                 .
  7250.                 .
  7251.              [TRIMCRVSEG
  7252.                  [CURVE ...
  7253.                  ]
  7254.              ]
  7255.          ]
  7256.      ]
  7257.  ]
  7258.  
  7259.  POINT_TYPE -> E1 | E2 | E3 | E4 | E5 | P1 | P2 | P3 | P4 | P5
  7260.  
  7261.  ATTRS -> [ATTRNAME ATTRVALUE]
  7262.           | [ATTRNAME]
  7263.           | [ATTRNAME ATTRVALUE] ATTRS
  7264.  
  7265.  
  7266.  Some notes:
  7267.  
  7268.  * This definition for the text file is designed to minimize the
  7269.    reading time and space. All information can be read without backward
  7270.    or forward referencing.
  7271.  
  7272.  * An OBJECT must never hold different geometry types or other entities.
  7273.    I.e. CURVEs, SURFACEs, and POLYGONs must all be in different OBJECTs.
  7274.  
  7275.  * Attributes should be ignored if not needed. The attribute list may have
  7276.    any length and is always terminated by a token that is NOT 'verb+[+'. This
  7277.    simplifies and disambiguates the parsing.
  7278.  
  7279.  * Comments may appear between 'verb+[+OBJECT ...verb+]+' blocks, or
  7280.    immediately after OBJECT OBJNAME, and only there.
  7281.  
  7282.    A comment body can be anything not containing the 'verb+[+' or the
  7283.    'verb+]+' tokens (signals start/end of block). Some of the comments in
  7284.    the above definition are illegal and appear there only of the sake
  7285.    of clarity.
  7286.  
  7287.  * It is preferred that geometric attributes such as NORNALs will be saved in
  7288.    the geometry structure level (POLYGON, CURVE or vertices) while graphical
  7289.    and others such as COLORs will be saved in the OBJECT level.
  7290.  
  7291.  * Objects may be contained in other objects to an arbitrary level.
  7292.  
  7293.  Here is an example that exercises most of the data format:
  7294.  
  7295.  This is a legal comment in a data file.
  7296.  [OBJECT DEMO
  7297.      [OBJECT REAL_NUM
  7298.          And this is also a legal comment.
  7299.          [NUMBER 4]
  7300.      ]
  7301.  
  7302.      [OBJECT A_VECTOR
  7303.          [VECTOR 1 2 3]
  7304.      ]
  7305.  
  7306.      [OBJECT CTL_POINT
  7307.          [CTLPT E3 1 2 3]
  7308.      ]
  7309.  
  7310.      [OBJECT STR_OBJ
  7311.          [STRING "string"]
  7312.      ]
  7313.  
  7314.      [OBJECT UNIT_MAT
  7315.          [MATRIX
  7316.             1 0 0 0
  7317.             0 1 0 0
  7318.             0 0 1 0
  7319.             0 0 0 1
  7320.          ]
  7321.      ]
  7322.  
  7323.      [OBJECT [COLOR 4] POLY1OBJ
  7324.          [POLYGON [PLANE 1 0 0 0.5] 4
  7325.              [-0.5 0.5 0.5]
  7326.              [-0.5 -0.5 0.5]
  7327.              [-0.5 -0.5 -0.5]
  7328.              [-0.5 0.5 -0.5]
  7329.          ]
  7330.          [POLYGON [PLANE 0 -1 0 0.5] 4
  7331.              [0.5 0.5 0.5]
  7332.              [-0.5 0.5 0.5]
  7333.              [-0.5 0.5 -0.5]
  7334.              [0.5 0.5 -0.5]
  7335.          ]
  7336.      ]
  7337.  
  7338.      [OBJECT [COLOR 63] ACURVE
  7339.          [CURVE BSPLINE 16 4 E2
  7340.              [KV 0 0 0 0 1 1 1 2 3 4 5 6 7 8 9 10 11 11 11 11]
  7341.              [0.874 0]
  7342.              [0.899333 0.0253333]
  7343.              [0.924667 0.0506667]
  7344.              [0.95 0.076]
  7345.              [0.95 0.76]
  7346.              [0.304 1.52]
  7347.              [0.304 1.9]
  7348.              [0.494 2.09]
  7349.              [0.722 2.242]
  7350.              [0.722 2.318]
  7351.              [0.38 2.508]
  7352.              [0.418 2.698]
  7353.              [0.57 2.812]
  7354.              [0.57 3.42]
  7355.              [0.19 3.572]
  7356.              [0 3.572]
  7357.          ]
  7358.      ]
  7359.  
  7360.      [OBJECT [COLOR 2] SOMESRF
  7361.          [SURFACE BEZIER 3 3 E3
  7362.              [0 0 0]
  7363.              [0.05 0.2 0.1]
  7364.              [0.1 0.05 0.2]
  7365.  
  7366.              [0.1 -0.2 0]
  7367.              [0.15 0.05 0.1]
  7368.              [0.2 -0.1 0.2]
  7369.  
  7370.              [0.2 0 0]
  7371.              [0.25 0.2 0.1]
  7372.              [0.3 0.05 0.2]
  7373.          ]
  7374.      ]
  7375.  ]
  7376. $
  7377.  
  7378. BUGS and LIMITATIONS
  7379.  
  7380.    Like any program of more than one line, it is far from being perfect.
  7381.  Some limitations, as well as simplifications, are laid out below.
  7382.  
  7383.  *  If the intersection curve of two objects falls exactly on polygon
  7384.     boundaries, for all polygons, the system will scream that the two objects
  7385.     do not intersect at all. Try to move one by EPSILON into the other.
  7386.     I probably should fix this one - it is supposed to be relatively easy.
  7387.  
  7388.  *  Avoid degenerate intersections that result with a point or a line.
  7389.     They will probably cause wrong propagation of the inner and outer part of
  7390.     one object relative to the other. Always extend your object beyond the
  7391.     other object.
  7392.  
  7393.  *  If two objects have no intersection in their boundary, IRIT assumes they
  7394.     are disjoint: a union simply combines them, and the other Boolean
  7395.     operators return a NULL object. One should find a FAST way (3D Jordan
  7396.     theorem) to find the relation between the two (A in B, B in A, A
  7397.     disjoint B) and according to that, make a decision.
  7398.  
  7399.  *  Since the boolean sum implementation constructs ruled surfaces with
  7400.     uniform speed, it might return a somewhat incorrect answer, given
  7401.     non-uniform input curves.
  7402.  
  7403.  *  The parser is out of hand and is difficult to maintain. There are several
  7404.     memory leaks there that one should fix.
  7405.  
  7406.  *  The X11 driver has no menu support (any easy way to have menus using
  7407.     Xlib!?).
  7408.  
  7409.  *  IBM R6000 fails to run the drivers in -s- mode.
  7410.  
  7411.  *  Rayshade complains a lot about degenerate polygons on irit2ray output.
  7412.     To alleviate the problem, change the 'equal' macro in common.h in libcommon
  7413.     of rayshade from EPSILON (1e-5) to 1e-7 or even lower.
  7414.  
  7415.  *  On the motif-based drivers (xmtdrvs etc.) clicking the mouse left and
  7416.     right of the scale's button produces stepped transformations. This
  7417.     step size is constant, and is not proportional to the distance between
  7418.     the mouse's position and the position of the button. The reason for the
  7419.     flaw is incorrect callback information returned from the scale in
  7420.     repeattive mode.
  7421.  
  7422.  *  Binary data files are not documented, nor will they be. They might
  7423.     change in the future and are in fact machine dependend. Hence, one
  7424.     platform might fail to read the other's binary data file.
  7425. $
  7426.  
  7427.  
  7428.